It is also possible that a particular food disagrees with him. This is not the same thing as an allergy. It is more akin to some Latins not being able to drink milk.
i was thinking acid reflux as well or something to do with his digestive system
You also want to have him checked for acid reflux (GERD). Nightime is the worst for this and if acid is backing up in his throat it will gag him and cause him to vomit. Get him to the doctor and in the meantime make sure his head is elevated when he sleeps.
Has he been checked for hernias? I'm thinking that a hiatal hernia, which pulls part of the stomach through a hole in the diaphragm into the abdominal cavity, might cause these symptoms. It's worth checking out, because at this age, dehydration can happen really quickly. Blessings!