Thank you for the query.Masturbation
rather has nothing to do with bowel movements. However it can be a problem when started in such young age.
Lose stool right after the meal for so long time can be a symptom of fistula between small intestine
and large intestine. In such case the stool is loose and undigested parts of the food can be present in it. The color is more yellow than brown. Food allergies
disease is also possible.
Such symptom can have mental source as well. But other reasons needs to be ruled out at first.
I suggest you to visit your doctor and have some diagnostics. Simple barium swallow and abdominal X-rays can tell if there is any fistula. Allergy tests
and stool tests should be also done.
Hope this will help.