In response to a comment from Dani & Frank, I'll offer my advice on potty training a puppy. It is what I did to potty train Loki. Obviously, it is not the only way, and you have to adjust methods to fit your own situation.
I am a graduate student and spend most of my time at home. This means that I had the luxury of watching a puppy almost all day long. Most people do not have this luxury. If both Yun & I were working full time jobs, I probably would not get a puppy at all. I would adopt an older, already potty trained, dog. Dog experts suggest that if you do get a puppy, that you then take all of your vacation time so that you can potty train your pup. To me, this sounds terrible. If I only have 2 weeks of vacation a year, there's no way that I would take it just to potty train a puppy.
Put your puppy on a strict schedule. For example:
7:30 am Morning potty break
8:00 am Breakfast
8:30 am After breakfast potty break
9:00 am Crate time
11:00 am Potty break
12:30 Play time
1:00 pm Lunch
1:30 pm After lunch potty break
2:00 pm Crate time
3:30 pm Potty Break
5:00 pm Play time
6:00 pm Potty Break
6:30 pm Crate time
8:00 pm Dinner
8:30 pm After dinner potty break
9:00 pm Play time
11:30 pm Night potty break
This is just a random schedule I made up. You have to adjust it to your life & your puppy.
To figure out how far apart your potty breaks need to be, the rule of thumb for a puppy is that they can hold it for as many hours as they are months old. So a 2 month old puppy can hold it for 2 hours. A 3 month old puppy can hold it for 3 hours. Etc. Personally, I found that Loki was able to hold it for an hour longer than that rule of thumb. So at 3 months, he could hold it for 4 hours.
Watch your pup like a Hawk
At all times, your dog should be either in his crate or being watched with 100% of someone's attention. This is important, because you must catch your puppy in the act of having an accident. You actually WANT accidents. This is your opportunity to teach your puppy where NOT to go. As soon as you see signs of your puppy wanting to go, or even if your puppy starts to go, immediately pick your dog up and off of the floor. I found this to be the most effective way to get Loki to stop. Yelling, "Nooooooooooooo!" from across the room doesn't actually work. But running over and picking him up always worked in stopping his stream of pee. Don't be mad. Don't yell. Be calm and just give a firm "No", "Uh-uh", or "Shhh". Then put your puppy down where you want him to go.
When your puppy goes in the correct spot, praise & treat. Personally, I found that Loki didn't care for treats after he pooped. My guess is that there is probably an aversion to eating immediately after pooping. There's a reason why poop jokes are not acceptable at the dinner table.
I think it took maybe a month or so for Loki to be at an accident rate of 1 accident per week. Then he remained at the rate of 1 accident per week for 2 months. In the end, he wasn't fully potty trained until 5 months of age.
Even the best trained/trainable puppies are still puppies. And puppies sometimes have accidents because they don't have good control of their bladder. Loki peed on a couple of our friends the first time he met them because he was so excited. And well, you just have to hope that your friends are dog friendly and don't mind too much.
Edit: You should never reprimand a puppy if you found the accident after the fact. The puppy will not understand. Dogs only understand associations when the associations are formed at the same time. They do not have memories and cannot associate something in the past (like having an accident) with something in the present (like your reprimand).