Keep the little dude in his crate even when you are at home. You might feel guilty about it for a while, but it will be well worth it in the long run. Our trainer told us that every accident a puppy has should result in at least two weeks to a month of confinement in the crate at any point when you aren’t able to devote your 100% full attention to him. Take him out every two hours and immediately go outside to pee, and praise him lavishly when he does, offering some really good treats, like real meat or cheese. Once he’s “empty,” you can take him inside to play with a little more freedom for 30-45 minutes without having anything to worry about. Then, back in the crate.
Puppies won’t pee in their crates, so this is the only way you can teach them that peeing does not happen indoors. He’ll get it eventually and then you can enjoy many years of companionship with your housebroken dog.
Here’s a copy/paste of what I said on the other thread that EvaBostonTerrier mentioned, FYI:
Crate training, crate training, crate training. Keep the dog in her crate absolutely 24/7 unless she is directly supervised. This will feel awful for you for a while, but the dog is really fine with it especially when she’s so small. You made it sound like she has peed in her crate before, which probably means the crate is too large. Get a puppy divider to keep her in a smaller portion of the cage, which will make her feel more secure and trigger her denning instinct, which will prevent her from wanting to pee in the area where she sleeps. Take her out about once an hour to pee, and stay out there until she does so, and when she does, go NUTS praising her and give her the best treats in the whole world – say, pieces of fresh deli meat or whatever she goes crazy for. Our dog trainer says “Why would your dog pee inside for free when they can get paid to do it outside?”
Also very important: don’t bring her back inside immediately after she pees/poops, or else she will learn that peeing and pooping means the end of outside time. After you go crazy praising and giving her treats, then let her have a few minutes to enjoy being outside. She’ll start doing it sooner that way.
I don’t have a small breed dog (mine is 29 lbs at 6 months) but this is based on copious reading and the advice of our trainer that we paid a fair bit of money to teach the puppy kindergarten class we attended for 6 weeks with the little rascal. Ours certainly isn’t perfect, and had a serious relapse around the 6 month mark when he suddenly decided that peeing on the carpet was preferable to going out in the cold and rain, but with every “accident” we restricted his freedom for a while and we’re making progress. Good luck, and please don’t give your dog back! There is hope!