If you're saying that he refuses to pee inside the house, then he's very well housetrained, and it is cruel not to take him outside where he is comfortable peeing.
When you say "pee at home" -do you mean in your garden or yard?
If he refuses to pee in the yard or garden, then the only solution is to make sure you take him for regular walks. He will need to go out first thing as soon as you are up in the morning, and also last thing at night before you go to bed, as well as regularly during the day.
If you mean -her refuses to pee anyway -even on a walk, then he desperately needs to go to the vet urgently, as he cannot go very long like this without excruciating pain.
I would take him to the vet. I'd be concerned that it hurts him to pee.
How old is your dog? You live in a place with a yard? Is this recent behavior?