I think Elmy provided a great answer, I got the same issue a year ago and wanted to tell my journey to provide some additional tips that might help you and others who are having the same problem.
I went to the vet with my cat and apparently, she had bladder stones. It hurt to pee for her, so she tried it in other spots, mainly at the door.
We treated for the bladder stones, but that was not enough, she now had kind of a bad relationship with the litterbox, so we had to switch to other litter.
We switched to litter that was easier on her paws (we had pellets, so we switched to small clumping litter) and was especially made to smell attractive to her (so not a lavender scented one that is made to smell good for humans, but one that is meant to smell good for cats).
And we placed a litterbox near the door for a while until she learned to go in the litter box again (not fun for us, but it was for the greater good).
It was a whole process, but now she never pees outside of the litterbox again.
Providing a litterbox near the spot where you don't want them to pee on the floor is always a great first step to quickly fix the problem until you found the root cause.
Also make sure to buy a product to neutralize the pee, because otherwise it leaves residue you can't see with the naked eye. But make sure not to use bleach because this smells like another cat to them and they would just pee more in that spot to give it their smell again. (my vet also gave the hint to clean the litterboxes with bleach for the same reason).