Like some people mentioned already, definitely get a crate for your puppy! Make sure to get one thats not too big but not too small either, but just enough room for it to get up and turn around and stand up, thats it. And whenever you're away or can't watch it, put it in there. It might take some time and there will be a lot of crying, so be prepared! Start by putting the little puppers in there at night when you go to sleep, preferably next to your bed so it can be near you and hear you sleep. Whenever it says in there peacefully give its LOTS of praise and treats, but don't take it out! This crate will now be its little "den" and it should always sleep in there at night.
As for the potty issues, never scold a dog when it goes inside or rub its face in it. As soon as you catch it, (remember put it in a crate when you can't watch it all the time and it should never go potty in the crate if its the right size)
shake a soda can with coins in it to distract the pup and pick it up and take it outside. If it goes again outside, praise like crazy! Also, its good to have a word or phrase like "hurry up" so it knows that thats what its suppose to do outside, not play in the middle of the night when you just want it to go potty!
Before you leave the house make sure you take it outside and have plenty of time to wait around for it to go, then praise when it does. And take it outside right when you come home too! A good rule of thumb is a puppy can hold it for however old it is like 5 months=5 hours and so on. And a puppy tends to need to go potty RIGHT after it eats a meal or after a lot of playing, so keep that in mind too. Hope this helps! I had to go through all the same things when my dog was a puppy too.