What age can you train a dog? Any age. Dogs are never too old or too young for training. The key is to give the dog something that's developmentally appropriate for her age. When it comes to puppies, even brand new ones, that means making sure that desired behaviors get rewarded and that undesired behaviors don't get practiced or rewarded. It means setting your puppy up to succeed and then rewarding her for her success.
Puppies are too young to train with intimidation, fear, or discomfort. In other articles, I'll get into why I think those things are generally inappropriate for older dogs too, but most people can see right away that they're not fair game for puppy training. Instead, you need to find ways to manage the behaviors you don't want, so they don't get practiced or rewarded, and reward and practice the behaviors you do want. That's how reinforcement creates reliable commands.
So, in order to have a dog that comes to you reliably, even when heavily distracted, it helps to lay the groundwork as early as possible in a puppy's life. The first principle of this training is to find ways to encourage your pup to come to you and to make it enjoyable for her.
Puppies are naturally social and naturally attracted to sound and movement. Pick a place that's not all that interesting, like a room in the house, or even the backyard if your pup is already used to it and isn't obsessively sniffing around. When your pup wanders a few feet away, make a little spectacle of yourself. Soft whistles, squeaks, and other high-pitched sounds are naturally interesting, as is motion, so shuffle or stamp your feet.
The object here is to get her attention and to get her to come to you without saying her name and without saying the cue word (e.g., "come"). She doesn't know "come" yet (or you wouldn't be reading this), and she probably doesn't really know her name. You don't want to throw wasted cues at a dog because that weakens the cue. You want her name to mean "look at the human" and "come" to mean "run right to the human and sit." The behavior needs to come before the cue, and then you attach the cue to it and reward. You should only use a cue when there's a strong chance the pup truly understands it and will obey it.
So you're shuffling and squeaking, and your pup hopefully perks up and runs right over. When she arrives, praise her and reward her. A yummy treat is great, but there are many other kinds of rewards, like toys, attention, gentle praise, and pets. Don't restrain her to give her her reward, or it won't be a reward. If your puppy doesn't want the treat, don't grab her collar and shove it in her face. If she'd rather sniff around some more than get pets, don't hold her so you can pet her more. When you are seeking to reward a dog, remember that rewards are defined by what the dog likes, not by what you think she should like. And when you've given the reward, be sure to release your dog back to whatever she was doing as soon as she successfully finishes the behavior and enjoys her reward. That release is a kind of reward in itself.
Repeat this game for a few minutes at a stretch several times a day. Once you feel like she's doing it consistently, you can add the cue, "come!" or "here!" when you're sure she's committing to coming to you. Remember, though, that you're laying the foundations of this skill, not polishing or proofing it. You're teaching this puppy that when you are a super fun human who is generous and rewarding when she comes over. You are teaching her that returning to you does not end playtime and is never unpleasant.
To that end, avoid the classic mistakes that people make when teaching recall. Never punish a dog, intentionally or otherwise, for coming to you. Sometimes we get frustrated when a pup is ignoring us, so we want to tell her "bad dog" in some way for that behavior. However, if you make coming to you an unpleasant experience, that's what the pup will remember. She will not understand that she is being punished for ignoring if she is punished when she finally gets back to you. Furthermore, scolding or otherwise punishing your dog, even if you manage to do it while she's ignoring you rather than while she's coming back, will not teach her to come any faster or make the behavior any more reliable in the long run. You want your dog to come to you joyfully because of trust and because of rewarded habit, not because she's afraid you'll yell at her or punish her for disobeying.
Also, don't repeat commands. If you misjudge and say a cue (like "come" or even her name), and she doesn't do what you want, don't repeat yourself. Every time you throw a wasted cue at your puppy, you teach her it has no value. If she doesn't come when you say "come," that's because she either doesn't understand or because whatever she's doing has more value to her than the habit and reward of the recall behavior you're working on. With puppies, this will frequently be the case, which is why you don't want to say her name or the cue in the early stages.
However, the more she successfully repeats the behavior of joyfully running back for a reward, the more powerful the habit will become. Once you have a consistent habit of a pup who runs to you, you can add her name and "come!" in low-distraction situations. With plenty of practice, good rewarding, and setting your dog up to succeed in more and more difficult situations, you are working toward a dog who can be handled off lead with no equipment or treats. And, one day, you'll be able to call your dog away from a stranger on the trail or from chasing birds at the salt marsh, and you'll feel like a training genius.