You poor cat probably has a urinary tract infection, which is common in male cats. There is no home remedy to cure it, he needs to see a vet. Those infections are extremely painful and may cause a future aversion to the litter box. Get him to the vet ASAP!!!