Your puppy is still a baby and too young to really learn to stay away from the door so keep him physically leashed when allowing him near the door, behind a baby gate to the room the front door is in, closed in another room or in his crate when you answer it. Once he's a bit older and has more capacity to learn, you can actually teach him not to approach the front door unless you invite him or bring him to it on the leash.
If you'd like, I can give you some pointers on how to do that as will other members but it is simply one of the hardest things to teach excitable, toy dogs and does take some weeks once the training begins before you can successfully keep them from door-darting. Therefore, you won't be able to rely on anti-door-darting training for quite some time to keep your baby safe.
In the meantime, to be safe, keep an ID tag on your little one and keep that baby away from the door as toy dogs dearly LOVE escaping out the front door!!! My Tibbe was just the worst door-darter his first few months here and still is if I don't keep his training refreshed but I have trained him to avoid the door and he's also trained not to leave his front yard. So even the time or two he has door-darted in the last couple of years when there was a crowd at the door(after I had lapsed on refreshing his front-door avoidance re-freshing training), he has stayed in his yard and came back in when called. Training - it works wonders - but for door-darting most of these little Yorkies do and the way they live their lives right under our feet and take part in everything we do, they still can be trained not to approach the door and they remember it as long as you keep refreshing the training - often.
To make the front door avoidance training work better, you need to also start regular obedience training with your little guy so that he'll learn in time to control his impulses, learn to respond to your commands for instant gratification(praise & treats), learn to see you as his pack leader who is to be obeyed at all times for that instant gratification and pride of accomplishment, learns to enjoy the work of training and how proud it makes him to work with you as a team-member. And the magic of obedience training is that over time, your dog learns to see you as his pack leader, respect you automatically, obey you by rote - without really thinking about it - just obeys out of habit when you tell him something. Of course no dog is really perfect - they forget, get badly distracted and can grow sluggish if we let them down by not refreshing the training or do it badly, dully and don't put fun and excitement, pride in the dog into it, but for the most part, training your puppy in simple obedience and simple "tricks" will pave the way for preventing door-darting through some additional, simple training and a create a well-behaved and happily submissive dog who enjoys obeying you for the pride you make him feel when he does. It makes for a lovely pet who rarely gives you problems as opposed to the often frantic, constantly barking, resource-guarding, occas. nipping/biting, destructive-of-your-things, house-peeing/pooping little horrors that many of them turn into from a lack of training or strong leadership.
__________________ Jeanie and Tibbe One must do the best one can. You may get some marks for a very imperfect answer: you will certainly get none for leaving the question alone. C. S. Lewis |