S.P.
I haven't read the other answers yet.
If he's having diarrhea, forget potty training
until that's over and done with.
Eczema, styes, diarrhea . . . poor kid.
He has been suffering.
I imagine the doctor will want to test for a variety of possibilities.
In addition to whatever meds the doctor may prescribe,
you may need to go back in food choices to an earlier age.
Simple baby cereal, rice, chicken, etc.
Then add back other foods gradually, one at a time.
Poor baby. Sending him hugs and cuddles.
S.