I will say this, and I will bold it, just to put the emphasis behind what I am about to say:
Schedule an appointment with your vet to follow up on this problem.
Stranguria/Polyuria are some conditions that need some very pointed questions and history to differentiate between the two, as well as urinalysis and possibly other diagnostic tests to help identify the specific problem. Now everyone above is correct that a UTI is common and could be the issue, but here is a SHORT list of other conditions it could be (and some VERY serious) that you need your vet to diagnose and treat:
Urinary calculi (bladder stones)
Prostatitis
Glomelulonephritis
Acute kidney failure
Chronic renal disease
Hypoadrenocorticism
Hyperadrenocorticism
Hypercalcemia of malignancy
Hyperparathyroidism
Diabetes Mellitus
Diabetes Insipidus
Bottom line, the only help or advice we can give you online is to go talk to your vet.
Also, this is a medical condition, so don't punish your dog for the accidents, he cannot help them. Go get some medical help to resolve the problem.