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.
Young puppies can’t hold their bowels & bladders for long. If you come home to find that they’ve had an accident in there it’s quite possible that they can’t hold it that long. Generally puppies can hold their bladder for about one hour per month of age. So your 3 month old pup can probably only hold their bladder for about 3 hours. If you’re going to be away at work for long periods of time see if you can get a neighbor, relative or dog sitter to come over to let your pup out during the day.
Clicker training, a common form of positive reinforcement, is a simple and effective dog training method. Although it is still fine to train your dog without clicker training, many people find it helpful. With clicker training, you can easily and effectively teach your dog all kinds of basic and advanced commands and tricks. It's fast and easy to learn how to clicker train your dog