First, being older, it is very important that you get at least a basic blood and urine test performed. You must rule-out underlying conditions like a urinary tract infection, kidney disease, diabetes, or Cushing's, that all could contribute to urination problems. Very important.
Now, if no issues are found, and there is a suspicion for urinary "incontinence" there are medications that can sometimes help.
But, if this is not incontinence related, and there is a specific medical condition, than the condition must be directly treated to try and help stop the inappropraite urination episodes on the rug.
So, first step, really needs to be a basic blood and urine test.
Hope that information helps