So, you put up a fence thinking that giving your dog a fenced in yard to play in would keep him at home. To your surprise, all he wants to do is jump the fence and go find a few friends to hang out with. This is nothing unusual in that it is only natural for a dog to want to roam and to hang out with his friends. But allowing him to roam loose can, at best, end up with a fine that has to be paid, but he could just as easily become injured or lost.
Part of the problem with trying to teach your dog not to jump the fence is that this behavior is "self-rewarding" in that by succeeding in getting over the fence your dog's reward is freedom. More importantly, each time he is successful merely serves to reinforce the behavior.
During training, the command you might use could simply be "No" or "Get Down" or even "Stop!". The most important thing to remember is that once you decide on a command, stick to it and use it with authority in your voice. Not only will this help to avoid confusion, it will let your pup know you mean business and expect him to obey immediately.
Remember, keeping your dog from escaping could save him from becoming seriously injured, lost, or killed. You could start this type of training while your pup is too small to actually jump over the fence by teaching him not to even jump on the fence at all. This way, by the time he could clear the top of the fence, he has no interest in even going near it.
There are a few things you can do before you start training your dog not to jump the fence. These include repairing any holes in the fence and, if you have a chain link fence, consider adding plastic slats to the fence to block him from seeing what's on the other side. Teaching your dog to stay in the back yard requires time, patience, and plenty of treats.
Try to choose a time of day when there aren't a lot of distractions like cars going by or kids out in the streets playing. You need your pup to remain fully focused on you and your training, which in turn will make the training go faster and help both of you reach the end goal much more quickly. Remember, teaching him to stop jumping the fence could save his life.