Dog stimulates himself to pee on bed instead of going outside

I have a 15 year old senior dog. I want to preface this by saying that he has been to the vet three times this year for a general checkup, and twice for specific issues. One being incontinence. He has been on a pill for two weeks now, and he was initially on antibiotics.

But to my point. I don't know if this has now become a habit, but my dog will stimulate himself to pee on the bed or on the couch instead of going outside. I will take him out several times a day (because he's old and in this habit) and he will just stand there or lay on their outside bed for however long I leave them out there for. The moment he comes back in, he starts licking himself until there's a big puddle of pee on the bed or couch. And he does this CONSISTENTLY throughout the day and night.

I take him out several times a day and he will pee three times - first thing in the morning, when my husband gets home from work, and last thing at night. He *might* pee an additional time during the day, but rarely.

The rest of the time, he's peeing on the blankets, bed and couch.

How do I get this to stop? I think the pills are working because if he lies there, at rest there are no wet spots. It's only when he specifically starts licking himself.

@Ali thank you. I'm sure it's pee because it smells of it, and once it's dry it's yellow. Very positive it's pee, I have to wash the bedding and throws twice weekly at the moment to keep the smell under control. He's on Previcox (because he has a growth in his bladder too, and this keeps the inflammation caused by it under control so he can pee (otherwise the inflammation is so bad it blocks his urethra and he's unable to pee), and for the incontinence he is now on Ethipramine, two twice a day.