Sounds like he is working on a serious gastric upset. Might be from eating something he shouldn't have or he may have picked up an intestinal parasite such as coccidia or giardia or worms.
You can see if a GasX tablet - about 1/4 of a regular strength one will help him.
If he has diarrhea and pain still tomorrow he should see the vet for an in person exam, diagnosis and treatment.
Hope this helps you!
Please press Accept if you find my answer helpful. Want more info? Just reply on your question!
Bonuses for good work are always appreciated!
Thanks for the opportunity to help you!