Aversion training is going out of fashion, and by that I mean harsh corrections be it spanking, harsh lead corrections etc, and most especially with a puppy (which I believe yours still is).
You may need to go back to tethering him to you so that he is 100% supervised when he is out of his crate, and take him for regular potty breaks. Also the areas that he has marked in have to be liberally doused with an enzymatic cleaner and then washed off.
Once in awhile Razz a full 5 yr old male will mark, but not often anymore. But then I outdoor train so no leg lifting at all in my house