So you are now finding out the TRUTH re why this poor dog lost his previous home. First of all, collect some of his urine and take it, fresh, with him to your vet for a full health check (you might collect some of his stool too for a fecal to see if he's carrying worms).
This poor dog has just lost his home and everything familiar so cut him some slack. Prevent/avoid and only once you can rule out a medical problem should you start to housetrain this dog, which has probably never been properly done. He probably spent most of his time shut out.
You must prevent him soiling indoors, especially if you are renting so back to puppy one which means taking him out immediately after each nap (and go with him to see what he's doing and when), after every meal, short periods of playing and for now, roughly every 2 hours extending to 4 as you get to grips with what's going on. When you can't supervise, use a crate or other confinement so he doesn't mess around the house. And confine overnight - you would be as well to take him out once overnight too, for now, because the fewer accidents he has, the faster he'll learn not to mess indoors.
Be calm with him, but be consistent - feed at regular times = knowing when he'll need to have a bowel movement. Digestion in the dog takes roughly 4 hours.
Praise when he empties outside. If after 5 minutes outside he does nothing, bring him back in and confine him to the room by the door to the outside - stay with him and if he squats, say No! and take him back outside. Correct ONLY in the act so he understands what you want. But above all, get his health checked, and be patient. Everybody will say the dog is house-trained when nine times out of ten, that's why he's out of a home. New baby or not (so sad).