Getting him neutered will absolutely help. This is classic behavior of an intact male. Then, when he comes home, you have to retrain him that any pee belongs outside, it will take a bit of training, but once the hormones have finished clearing his body, he will be so much less compelled to mark everything that it will be much easier. Make sure you clean everywhere he has "marked" with a good enzymatic cleaner so nothing sys, "good spot to pee here" to his doggie nose, and that will also help!

It will also be better for his health in the long run, and for your sanity! Good luck!