I saw your post and I just wanted to give you some ideas, because my own cat Cali was peeing in a corner upstairs. After switching numerous things that were suggested on websites I realized that the problem wasn't a physical one. I created a routine for her. I wake up at night ( I work third shift). I give her a small can of wet food, change her water, and while she is eating I clean her litter box. I put "her blanket" on my lap ( so she knows to come lay with me, and she will jump up and lay with me for a bit). When I get home from work I give her time to, and I always use "her blanket" to let her know when I'm ready for her to come sit on my lap. We also gated the stairs to the upstairs level off from her, and noticed that she would pee if we let any of the doors or windows open. It sounds to me like you've tried everything, so try doing a routine for a month with him. We also have two litter boxes for her, one about 3 inches of litter and one has about 5 inches. *shrugs* maybe I'm a little bit odd, but we finally found the right combination for her. Let me know what you think.. ohh and one more thing.. I read somewhere that cats don't like rough or scratchy surfaces, so if you have a mat under the box I would try taking it away for a little.
I changed the litter brand twice. I'm running out of ideas!
My male cat also pees on the carpet and goes number two but we have two male cats they say two males won't use the same litter pan. they are the same age and same sac twins one goes in it and one won't.. I had to get two litter pans still he would not use it. I changed the cat litter in his and now he will use it have you tried changing the litter brand??
His litterbox is full sized. I moved it about 2 weeks ago to his favorite pee spot in front of my closet. He will still walk to the side of it and pee. If I catch him and put him in it, he will hop out, but eventually goes back and uses it. I thought at first this was because of a UTI but he was treated for that and nothing changed.
If you use dirt, be ready to give the cat wormer afterward, since roundworm larvae are common in a lot of native and packaged soil. (I remember a figure from somewhere that stated 85% of commercial potting soil contained roundworm larvae.) So watch out.
How big is your litterbox? If it is a half-sized one, it may be too small for him, or if it is out against a wall, in the open, he might feel threatened. Try moving the litterbox to one of the places that he urinates on the carpet most commonly, he might be encouraged to use it, if it is in one of 'his spots.'
I had the same problem with my male cat. First is the litter box covered if so take the cover try taking the cover off. With my male that fixed the problem. Cats will naturally try and pee in corners and next to walls when not using the litter box because that is how they try and hide their pee unless he is spraying his pee he isn't marking his teratory spraying involves specific tail movements in males and usually is a more concentrated urine. Sometimes changing for a short time to dirt I mean dirt like form a garden can help. I hope this helps