Whether or not your cat is allowed outdoors, you certainly don’t want him charging past you as you’re opening the door.
You should never greet or pet your cat right at the front door (or whatever door you use to enter and exit). If you call your kitty the moment you walk in the door, he may begin to wait there as the time of your arrival grows closer. The sound of your key in the lock could be his cue to slip through as you open the door. Instead of greeting your cat right at the door, walk over to a spot a few feet inside the entrance and make that the official greeting area. Ignore him until you got to that spot. If you do this repeatedly, he may begin to wait for you closer to that inside spot rather than at the door.
To prevent your cat form running out the door when you’re trying to leave the house, say your good-bye to him in a specific spot (such as at his cat tree). You could place a treat-filled activity toy there as you are going so he’ll have something with which to occupy himself. If your cat isn’t food-motivated at the moment you’re going out, toss a toy away from the door.
For more advice on ways raising a well-adjusted and -behaved cat, read Think Like a Cat from www.tuftscatnip.com.