If he has not done this before, there is a good chance this is a medical problem. Urinary tract infection or bladder stones are the likely culprits. Either may give him a sudden urge to pee. He is due a trip to the vet.
P.S. Do not let him pee on his way in. They are going to want a urine sample :)
