Welcome back to Healthcare Magic Physician's Desk!
Your nephew has got truly altered bowel habits.
when his bowel is empty he is just passing the gas and the mucus because there is no solids due to preceding loose bowel motions.
You should get his stool examination and if possible a colonoscopy
He might be having an inflammatory bowel disease
or a chronic infection.
Wish you a great health!