When you have to leave the puppy alone, you’ll need to confine it to a crate. This will prevent the puppy from peeing and pooping all over your home, and will also help teach it control, since it won’t want to soil the crate. However, young puppies need frequent bathroom breaks, so you’ll also need to ask a friend or pet-sitter to stop by and let the puppy out throughout the day until it’s old enough to go for longer stretches without needing to use the bathroom.
Remember that training is an ongoing process. You will never be completely finished. It is important to keep working on obedience training throughout the life of your dog. People who learn a language at a young age but stop speaking that language may forget much of it as they grow older. The same goes for your dog: use it or lose it. Running through even the most basic tricks and commands will help them stay fresh in your dog's mind. Plus, it's a great way to spend time with your dog.
It’s best not to punish the puppy for making a mistake. Instead, focus on praising appropriate bathroom behavior. If you catch your puppy in the act, interrupt it by saying “No!” in a firm voice or clapping your hands loudly, then take the puppy outside to finish going to the bathroom. Never swat your puppy, yell at it, or try to rub its nose in the mess.