welcome to HCM!
There are a lot of reasons of vomiting
but the most common cause for vomiting is infection that is gastroenteritis
,other causes are food allergies,anxiety and food poisoning
For your concern of dehydration
,after vomiting, wait 30 to 60 minutes before giving him anything. After the tummy has had a little time to settle, offer a teaspoon of oral rehydration fluids and other liquids. If that stays down, offer another teaspoon a few minutes later,give small amounts frequently instead of large amounts all at once.
Hold off on solid foods until it’s been six hours since the last vomiting episode. Then try bland, easily digested foods but avoid spicy or fatty foods. Go slow.
consult a pediatrician
and get your child examined .
I sincerely hope this will help you.Take care!