
This isn't a toilet training problem as such but inaapropriate marking behaviour.
As such it will be much harder to train out and will require constant supervison. As soon as he looks like he might lift his leg you should tell him no and take him outside. when you can't watch him I suggest you crate him.
Also make sure you clean the ares he marked with productst that don't contain amonia. Biological Washing Powder and Spirit vinegar are good.
In the USA they put Belly Bends on the dog. Basically an elastic bandage with a pad so if the dog goes to pee it pees itself, which it will find upleasnat and may help, and at least contains the problem. Of course these would have to be chqanged regularly and he woudl need his tummy arte washed wel several times a day (baby bath liquid would be good).