Hi and Welcome to YT!
I would start by putting a Belly Band on his to stop his marking... or at least control it a bit.
Then, I would start training him the same way one trains a puppy. A schedule would make it easier. It can be done.
Here's a list of threads to read:
housetraining - Google Search