I need some advice 😔

Marie☺️💕
Some back story, one of my cats, O.J., is 17 or 18 years old. He is pretty healthy, with the exception of him having a pretty significant cough, (hairball type cough, have taken him to 3 vets and they all say his lungs are fine) and he has about an inch sized tumor on the top of his rear left leg towards his back. Other than that he eats fine, plays sometimes, and is in fine shape. 
Now here is my problem. Recently, he has been peeing outside of his litter box. On the kitchen floor, bathroom floor, any rug that gets put down, and in the upstairs hallway (where we just got 900$ carpet installed 😑😑😑) we have tried enzyme cleaners, odo-ban, plug in diffusers for cat stress or anxiety, and nothing has helped. I am 9 months pregnant and my baby is due in 2 weeks. My question is, what do I do!!?? Should I have him put down? I love him so much he was my first cat ever, but I am getting so frustrated with the pissing everywhere and so tired of cleaning it up! He still goes in his litter box sometimes I don't understand why he is leeing on the floor. We change his litter box daily so I don't think that's the problem. I just feel so horrible for wanting to put him down just because he's peeing everywhere but it's ruining my house and I don't want him ruining all of my new baby items we have for my daughter. Any advice would be greatly appreciated I am so confused as to what to do.