Dogs run -- that's what they love to do. But running away or out of the yard is not only unacceptable behavior from your beloved pet, it can be dangerous for him and anyone chasing after him. So get tough -- and bring on the training.
Establish yourself as the boss. Your dog needs to see you as the pack leader so he listens the first time. Praise him when he responds to you immediately; when he does not, reprimand him firmly and enforce the response by putting him on a leash so he must comply. Be consistent and do not let him get away with anything or bolting out of the gate will be his next trick.
Teach your dog basic commands so they become an automatic response. Start with "sit," "down," "come" and "stay" -- these should be practiced daily until your dog can follow commands easily. Praise him lavishly when he complies, and even give him an occasional treat. When the gate is opened and your dog's running impulse kicks in, an issued command from his pack leader should be enough to stop him.
Practice having your dog come to you while he is on a leash. Purchase a long lead and allow him to walk around the yard. Command him to "come." Praise him lavishly when he does so immediately; if he does not, pull him back to you with the lead. Continue this exercise until he comes to you every time. Then, practice without the lead. When the gate is opened and temptation rears its head, your dog should be able to respond to your verbal command of "come" as if he were on the leash.
Do not punish your dog for running away or he'll equate punishment with "come" the next time he tries bolting. Instead, praise him for returning, and continue to work with him until his training overtakes his canine impulses.