Dogs instinctively wish to protect their territory, and don't need abuse or all-day confinement to serve the purpose of compound security. A happy, healthy, well-fed and watered dog is in the best position to guard and protect a home, and many dogs breeds make excellent security dogs.
It is unfortunate misinformation that locking a dog in a box all day, every day or feeding it things like chili will make him or her a better guard dog. These are not true, and can have very negative consequences. It is also inhumane. Being locked up is bad for the general health, skin health and mental stability of a dog.
A dog will guard your house because he or she sees it as their territory, thus the more time the dog spends outside of its box or kennel, the better he or she is able to know the compound and thus, to defend it.
Your animal also wishes to be part of your "pack", and through bonding with your animal, he will better protect you, your home and your family. Ways to bond with your family include giving it attention, exercise, love, protection and food and water. Dogs are social creatures and do not do well in total isolation.
To train a dog for attack takes years of specialized training. Sending a dog away for a few weeks to a training facility to learn to attack is dangerous, and instead requires far longer and very qualified trainers.