By playing some simple games like fetch with your dog, you can kill 2 birds with one stone. First is that the actual playing of the game will surely tire them out so much that they won’t have the energy to jump the fence. Second is that you are associating the fun of the game with the yard. If they have fond memories of the yard they will be less likely to try and get out.
Redirect with a sit command. The simple 'sit' command can be useful in many different situations. Most importantly, it is a great distraction technique for redirecting your dog's attention from an undesirable behavior, such as jumping up. When your dog jumps up on you, turn your back to them while keeping them in your peripheral vision. Ask her to sit and immediately praise her when she does so.
Determining if this is your dog is a little more complicated, but it is often seen when your dog isn’t very excited (or that there isn’t much of a reason to be excited). This is more than likely to happen when you are in their way or have something that they want. They will usually jump on you and try to push you back more than just jumping up to give you kisses. Often times they will jump on you and try to hold on when you push them away or try to move into them. Sometimes moving into them may elicit a growl because they want to back you off. 
Remember, Jumping up can be dangerous as well as annoying. Just as many owners are sued for their jumping dogs as their biting dogs. Young children and elderly people can easily be toppled over and seriously injured by exuberant, friendly dogs. Start now to teach your puppy not to jump up. Even little dogs can cause problems and injury to themselves and others when they jump up.
Puppies in human households try to lick the weird, flat, usually bald body part we have instead of a muzzle. When a cute little puppy jumps up to lick face, many people can only say “Awwww!” Hey presto! Jumping up has been rewarded. The puppy’s natural inclination is now a learned behavior. Too bad for the dog when he’s nine months old, bigger and less cute, muddying the pinstripes and knocking Granny to the ground.
×