My old beagle, on the first day we had brought him home, run straight for the bathroom to pee. He was still an untrained puppy so we didn't pay much attention to that. Years later, he wouldn't pee or poop around in his cage, apart from one certain area at our old place and then later in our new place, he did everything straight in the drain hole. Heck, I remember when my dad took him to mate with another beagle, he was so disgusted by how dirty the cage of that dog was, he stood on one frigging paw and wouldn't approach the female until the cage was clean. He was so crazy my little Tommy boy.
Well, anyway. Best way to not have your dog mess your place up, is to pick a certain hour for walking him and don't change it for a while. Pick at least an hour after he eats or in the morning when you wake up. My pekingese for example, knows that when the sun goes down and it's dark, it's time for his evening walk and will jump all over the place like a puppy. Also your dog will slowly learn that outside = toilet and will let you know when he wants to go out of his normal time. Tito always sits there and whines at me if it's urgent. XD