I would take him to the vet. My last dog started doing just that, at about 12 years. Ended up he had adrenal gland problems which eventually led to his downfall, but there could be many causes which are very treatable.
A well trained dog (heck, pretty much every dog) never wants to pee where he or his pack lives if he can at all help it.