Certain signs you will alert you that your puppy needs to go outside. These include:
your pup walks around in circles.
Sits or whines at the door.
Sniffs at the ground.
There are also times when you should ensure you take your puppy outside anyway.
First thing in the morning.
After every sleep.
After being left alone for a period of time.
After every meal.
Last thing before you put your puppy to bed.
Of course accidents will happen! If you catch your puppy in the act you should immediately take him/her outside. NEVER smack your puppy, rub their nose in it, or reprimand him/her after an accident has occurred. A puppy is too young to be able to connect this with what he has done wrong. As they get a little older, the best approach is to take them outside when you see the signs, wait for them to do the right thing then reward them with lots of love and enthusiastic praise (a treat will work as well but the former is better). This works, punishment does not.
Using praise is the best method of training. Puppies only want to please their owners. Give your puppy lots of praise whenever they do the right thing. Here is a helpful link to a basic puppy training guide courtesy of the Dogs Trust