You need to begin teaching stay in a quite room with no distractions. Then gradually add distractions to help him master it.
Have your dog sit or lie down in front of you.
Count to two in your head and click and treat. If he moves before you click go back and start again.
Tip: once you've clicked he's allowed to move around. The click releases him from the stay position.
Very gradually increase the time he has to stay before you click and treat, until he is patiently staying in position for a whole ten seconds before you click and treat.
Now that he's learned how to stay you can add the verbal cue, "stay," to the behavior, by saying stay and then clicking and treating if he stays.
Now that you've taught him how to stay in the same position for a duration of time, it's time to teach him to stay at a distance.
Give the cue to stay by saying "stay."
Take one step back.
Click and treat if he stays. If he moves before you click, go back and start again.
Ask him to stay, take two steps away from him and click and treat if he stays. If he moves, go back and start again.
Repeat this, taking more and more steps until you're across the room before you click and treat.
Once you are able to make it across the room with him staying in position you can increase the duration of time he stays before you click. Stand across the room and wait one second, then click and treat. Then wait two seconds, and click and treat. Until you're across the room and he stays in position for as long as you want.
If your dog doesn't come to you to get the treat after you click, immediately hold the treat out after clicking and approach him and praise him. This will teach him that when he hears the click he is released from the stay position.
After he's mastered stay at a long distance, for a long period of time (maybe a minute or two, or more -- it's up to you), you can replace the click with a release word. To do this, say the release word right before you click. For example, say "release" and then click and treat. Gradually decrease the volume of the click until you aren't clicking anymore and are only saying the release word and following it with a treat.
Next: Come