Teaching the COME command can save your dog's life and is always one of the first things (besides the potty training issues) I teach my dogs.

Start with a long line about 15 to 20 feet. Inside the house using about 10 feet of the long line, Call the dogs name and when he looks at you say "COME" in a excited or happy tone. When the dog comes to you reward it with a small treat or piece of kibble and make a big fuss. Keep repeating this until the dog consistently comes to you. Make sure you are reinforcing the treat with verbal praise. You can show the dog the treat at first but once the dog understands what you want, then you want to have the treat with you but where the dog can't see it. Immediately when the dog comes it is rewarded even though it can't see the treat.

Once you have this down add a couple of distractions. A favorite toy, someone else in the room, etc. When the dog consistently comes to you with distractions (still rewarding with treats or kibble that is unseen) move the training process outside.

Lengthen the line up to 15 and then 20 feet following the same procedure as above. Come outside without distractions and then come outside with distractions.

When this is all complete you should have a dog that comes to you under any circumstance.