Once they get past the young puppy stage, I'm not sure that you can trust them totally with an open door. I'm all for training, but that's asking - and risking - alot.
In order to keep him safe, I'd either close the door, put a baby gate across the door, or keep him on a leash.
If you really want to train him to stay away from the door, clicker training would work well. Visit this website for all the basics:
www.clickertraining.com. It's an awesome website. If you decide to go that route, let us know. Those of us who use clicker-training can suggest ways to go about it.
But, again, if you want to keep him 100% safe, you're going to have to use management in addition to training.