In my work as an animal behavioral specialist (the training of animals), the real work and training is not with the animal as much as it is with the person(s) who care for the animal.
Always positive reinforcement, never punishment or yelling.
You have to watch your puppy and learn what he does when he needs to go potty and take him out before it happens. (First thing in the morning, just after he eats or drinks, just after he's woke from a nap, just after he finishes playing, when you notice he starts smelling around the floor etc). As you are on your way to the door to go outside, always use the same words so he knows what they mean over time. (Go outside? Go potty? etc). AS he is going potty and for a good while after - it is happy happy puppy celebration time. Let him know he did something very good.
If you love and care for your puppy he will want to love and care for you. The way he does that is by trying to please you. It is up to you to help him understand what you want and it is up to you to try to understand him based on his behaviors.