Catch him in the act so that you can correct behavior. Close doors to rooms. Crate when not supervised. Has absolutely nothing to do with his testicles.
Crate him when she's not able to directly supervise, and use a belly wrap when he's out of the crate. Definitely not a testicle issue - this is a training/dominance issue.
Put a training collar and leash on the dog and take him to the spot where he has marked in the house. The minute he tries to lift his leg give a sharp correction on the leash and a verbal correction. Neutering will not stop marking. Training will Good luck