Learn training drills from expert dog trainers or by simply buying a book about it. Letting your dog go through training drills can help a lot, since such drills can make him acquire new skills.
Learn about the different training drills, and practice them one at a time, so that you can make your dog a skillful one.
Special Article: The 10 Most Loyal Guard Dog Breeds
Punishment suppresses a behavior
When you punish your dog for misbehaving, you need to keep in mind that it only suppresses it.
In other words, it does not eliminate the behavior entirely. Thus, you need to take note that it is still very possible for him to repeat his bad habit again.
Monitor his actions all the time, so that you can remind him that misbehaving is not good.