Be persistent! Make sure the puppy doesn't get the opportunity to pee and poop by using a leash indoors or confining him to a crate when you're out. Depending on the puppies age, pop him outside every 20 - 30 minutes, so there's a greater chance of him toileting outside (by accident at first.) In addition, get rid of any scent markers he's left by peeing or pooping indoors, as these will draw him back to the same spot. This means cleaning the area daily, for 2- 3 weeks after he last pooped there to fully get rid of any lingering odor that the dog can detect.
Often, the sit command will be one of the easiest for your dog to learn first. Next, you can train your dog to lie down. At the same time, work on teaching your dog to stay. In addition, your dog should be trained to come when called as soon as possible. This is one of the most important fundamental commands. Once your dog has mastered these dog obedience basics, you can move on to fun tricks and advanced commands.
One of the easiest ways to prevent accidents is learning to recognize when your puppy needs to go out. Most puppies will sniff the ground when they’re getting ready to potty, but there are many other more signals that happen prior to sniffing. Puppies that pace, seem distracted and walk away from play are subtly signaling that they have to go out. If your puppy tries to sneak out of the room, take a potty break right away.