Well, the first thing I would do is have him checked for a urinary tract infection. Although he is young, males are more prone to getting them. Cats usually don't pee to mark territory. They will spray on something vertical. He is also a bit young to be doing this. If all checks out at the vet, if the house is a good size, I would add another litter box closer to the bedroom. Wee ones tend to forget where the litter box is once they curl up and get cozy. If you are going to confine him, I would do it in just one room(maybe where the litter will be) and keep his food and water in there for a week. Don't let him roam the house, he will get confused. Essentially you would be re training him.