Thank you for your query,
Your son seems to have acute gastroenteritis
may be a viral or bacterial.
It may be because of some contamination.
Give sips of oral rehydrating solutions like ORS, coconut water, lemon water, dal water to prevent dehydration
and zinc can be give to hasten the recovery from intestinal infection.
You observe whether every time after coconut milk he is developing the loose motions. If it is like that you can stop it.
If loose motions are not coming down consult your Pediatrician
Hope I have answered your query.