Sit/stay and down/stay will both work from the same principle, so I won't retype for the down/stay.
To start, put your leashed dog into a sit and firmly pet him starting from his head to as far down his back as you can reach without bending over too much. Make sure the dog is positioned in the classic left-side heel position. Next, put your hand in front of your dogs eyes (you don't have to touch him) and say "stay". Then take one step so that you are standing directly in front of the dog. Wait one second, return to your starting point and praise; a very simple "Good" and a quick pet. Repeat this sequence, moving further and further away and increasing the time spent in a stay. If your dog breaks the stay, correct as soon as the butt starts to lift. Put them back in the sit and start from the first little step again. Also, don't just go to the end of the leash and stand there counting the seconds. Move around, side-step, do a jig, anything movement wise. This will serve to teach your dog to remain in a stay around distraction and gives your dog something to focus on besides how much time has passed.
To stop running out the door, use a "wait" command. To practice, find any sort of doorway in your house. Next, as you approach the doorway, tell the dog "Sparky, wait" and do a sort of chopping motion in front of the dog. You have now put up an invisible barrier which the dog may not cross before you give the release command. You step through the door and face the dog,wait only one second or so to start with, then praise and release the dog to go through the doorway. Repeat 7-10 times a session and make sure to practice going both ways. Increase the time as you feel your dog understands. If they start to move through the doorway, tell them "No, wait" as you're putting them back into where you had them. In a "wait", the dog can sit, stand, lie down, sniff around, just not cross that boundry until you say so. This is different from "stay". Stay means to hold that exact position until you have returned to the dog and released him. You can call your dog to you from a 'wait" but never a stay.