Imagine your puppy running out the front door. You call him, waving a treat. But he'd rather chase a squirrel into the road than come back to munch on a treat. In addition to the obvious danger of Puppy getting hit by a car, he learns that he doesn't have to listen to you. He learns that he's in charge of what he decides to do and what he decides not to do.
The next option is called luring. Get down in front of your puppy, holding a treat as a lure. Put the treat right in front of the pup’s nose, then slowly lift the food above his head. He will probably sit as he lifts his head to nibble at the treat. Allow him to eat the treat when his bottom touches the ground. Repeat one or two times with the food lure, then remove the food and use just your empty hand, but continue to reward the puppy after he sits. Once he understands the hand signal to sit, you can begin saying “sit” right before you give the hand signal.
It typically takes 4-6 months for a puppy to be fully house trained, but some puppies may take up to a year. Size can be a predictor. For instance, smaller breeds have smaller bladders and higher metabolisms and require more frequent trips outside. Your puppy's previous living conditions are another predictor. You may find that you need to help your puppy break old habits in order to establish more desirable ones.