He needs a clinical examination with urine analysis to rule out urinary tract infection or presence of crystals. If you are from Bengaluru, you can book a home consultation with a veterinarian. If not, you can opt of online consultation to discuss in detail about this.
Or if he is passing loose stools, it could be due to bacteria or worms or change of diet. I advise you to book a consultation with any one of us to discuss in detail about this.