Don't give worm meds unless he has worms and the only way to tell that is with a fecal check done by a vet.
Plain canned pumpkin with nothing else added will help to stop the problem. You can offer some as a licky treat.
Pedialyte can be given in a water bowl and offered as a free choice, let him drink as much as possible.
He needs to be checked for dehydration, you can do that by picking up the skin on his back. If it stays up, he is dehydrated and needs to get to the vet immediately.
Has you little one ever had fecal checks? Giardia can be a main cause of diarrhea