This is one command you humans find difficult, usually because you sometimes reward us for “come” and not stay!
It is best if the dog is sitting. You can try with a long leash at first and just hold out your palm like ‘stop”. Take a step away, say “stay” wait for a few seconds and you must walk back to the dog and give him praise and a treat but only if he is still sitting!
Do this many time and after a while go a little further away; just an extra step to begin with.
Maybe start this at home or in the garden, then do it often in different places like the park or at a friend’s house.
Just slowly increase the time you want your dog to stay. Do this often but increase the time by a few seconds only each time.
Keep your eye on your dog and if you think he is going to move, go back quickly and try to reward him BEFORE he moves. Once he understands the palm out and “stay” you can then start trying with your dog standing. This video might help How to teach your dog to stay.