I do not want to alarm you but I am very concerned about your boy.These are very serious and can even be life threatening symptoms Any time a cat cant stay out of his box he is either sick or in pain.
You should make a trip to the vet ASAP. - If you think he has a urinary tract infection and is in danger of becoming blocked.
UTI's are serious in males because they are caused by sticky crystals in the bladder.At any time they can block the urethra.Since this is going on a while your boy is in great danger.Cats are very stoic animals so he may not cry out.
If he becomes unable to urinate that is a MEDICAL EMERGENCY . His bladder could burst and he would have to be catheterized to save his life.
If that is the case, you must take him to the vet right away
http://www.carecredit.com/ may finance his visit if money is an issue.
He may have a UTI that can be treated economically.
UTI's must be treated with an effective broad spectrum antibiotic like Clavamox or clidimycin and for a long enough duration so all bacteria is eradicated. If not, they will refluorish, stronger and more resistant and reinfect him. In addition, the bacteria can become tolerant of the same antibiotic so the medication should be varied for best results.
You can give him a few drops of unsweetened cranberry juice or 100 mg of vitamin C - That will reduce the PH of his urine but it is only to make him feel better.He still needs to see a vet for an antibiotic.
Please let me know how he is doing .I will be here till late tonight to help further.
I hope he feels better very soon.
PLEASE take him right in to be treated.
Best wishes for him,