(In Progress) Housetraining is a big enough (and difficult enough!) topic for a section on its own. It's usually easy to housetrain a puppy, but when housetraining goes wrong, it's one of the most difficult and distressing problems to solve.
We'll start with how to housetrain correctly, try to understand how pups learn elimination behaviour, and then look at solving common elimination problems.
The most important thing to understand about elimination is that it is self-reinforcing.
That means simply that an animal feels the same relief you do at being able to let loose, urinate or defecate, and relieve bladder or bowel pressure. Unlike you, though, an animal has not been potty trained and is not forced to cart about all sorts of Freudian hangups about appropriate and inappropriate toilet behaviour!
The second most important thing to understand about elimination is what triggers it, apart from the obvious internal trigger of needing to go.
In the beginning
Newborn puppies cannot relieve themselves. Until they are three weeks old, mother has to stimulate urination and defecation by licking the peri-anal area. She also cleans up after the pup, licking up and eating whatever he or she produces, probably as a defence against predators finding the litter by smell.
By the time the pups are 3 weeks old, their ears and eyes are open and they are moving around quite a lot, although their hind legs are still a bit wobbly. I'm sure I'm not the only person who has collected up a litter of 3-week-old puppies and put them down outside the whelping box for their evening exercise, only to have all eight of them (or 10, or 15!) squat simultaneously and wee on the floor for the very first time!
This is where a knowledgeable breeder can make your life as a puppy owner much easier. At this stage, pups learn very quickly to move away from their sleeping area (in fact this seems to be an instinctive behaviour). They won't move far, however, and what will usually trigger elimination is a change of substrate, or whatever they can feel under their feet. Assuming the weather and the whelping room arrangements allow it, this is the time to get the pups onto grass as much as possible. The substrate near the whelping box rapidly becomes a cue, or trigger, for eliminating, and if this is tile or carpet, the breeder is (usually unwittingly) setting you up for a difficult housetraining exercise. First prize is grass, and the next best thing is newspaper.
So one of the things to do when collecting your pup is to find out where the pups were kept, how much time they spent outside, and what the floor surface near their sleeping area was.
Breeders generally do the best they can, and that best includes a great deal of cleaning up, so don't blame the breeder or go elsewhere if the pups have been allowed to mess on lino, concrete or carpet. Just be aware that your housetraining exercise will be much simpler if you can prevent the pup from having access to the same types of flooring for his first couple of weeks in his new home.