I went through the same thing when I had a puppy til I realized the best thing is a crate.
I know some people may think it is cruel to put dogs in crates but it is the kindest and quickest way to train them. They will not soil the place they nest in so they will hold it in. Of course you can't expect a young puppy to last a long time.
The key with the metal crate is to get one just a little bigger than the dog or one that can easily be adjusted in size. Many shelters will actually let you borrow/rent them cause they know people will only put the dog up for adoption if not trained properly.
Even after the dog is housebroken you can leave the crate (if you buy one) in the house and they will often use it on their own. They will feel safe and secure in there. You can even put some cardboard around two or three sides to increase the feeling of security.
You also have to tune yourself into the puppy's mind and get to know when they need to go out. Usually just after feeding, just after waking up, or after playtime you should make a practice of taking the pup out. That will avoid many accidents.
If you do have an accident it is imperative that you use white vinegar or one of those citrus or special liquids that eliminate the urea scent that would if left there, encourage them to go back to that spot and pee again. That is a normal thing as dogs will go where others have. Don't use ammonia as it has the same chemical consistency as urea and will actually attract the animals to go on that spot.
Above all, be patient. It's a difficult few months until they are trained and the teething process is over. I used the bitter apple but found that a touch of Tabasco sauce was much more effective. But expect them to be "kids" until at least 6 months or more. At that age it is not too soon to look into a dog training class. My second dog was a real trial. Before I bought the crate she got into a bag of styrofoam bits while I was gone and shook it all over the house...it looked like it had snowed indoors
. I ended up taking her to 4 different dog classes of many sessions each. She got better with practice at home and by the last class graduated first with almost perfect behavior in commands on and off leash. I could even put a cookie on her nose and she wouldn't flinch until I said OK. She never behaved badly or had an accident until the last few months of her life when she was ill.
Good luck.