I agree, maybe you should have him checked out for an infection. Or, as been said, just try re-housebreaking your dog. Make sure to clean up the pee and mask the scent properly each time he pees in a bad place.

Good luck.