Could be prostatitis. He does need to see a vet in the next day or so. Sooner if he becomes acutely uncomfortable.
This is common in intact males. It could also be a UTI, which can turn very painful and messy, very fast.
Only a vet can say what's wrong. Hope you can get him in soon.
Nobody on the internet can diagnose him. You need to have him diagnosed by a veterinarian. Prostate cancer is not unheard of in dogs, so please don't wait. Even if it's a urinary tract infection that can be cured with antibiotics, he's got to miserable, and you'll still need to see the vet for that. Cranberry supplements like Cran Assure can make him more comfortable if it's a UTI, but will not cure the underlying infection.
Have you researched your area for a 24 hour emergency vet clinic? I would hate to see the poor guy so sick if it's a scheduling problem with your vet.