There is no direct relation of pneumonia and stomach illness but prolonged use of antibiotics may kill good bacteria of the gut which leads to indigestion and bloating.
Repeated illness till 5yrs of age is common due to weak immunity.
If weight and height is not growing well then your son needs complete evaluation.
Next Steps
Start
vitamin B12 and folic acid tablets.
give curd and fruits in his diet.
Health Tips
take care of his diet, ensure passing stools daily, vaccination is important.