Hi welcome to Health care magic forum. It must be a lactose intolarance, that is why doctors kept him on lactose free formula, now as he is 7 months old you can try veining semi solid food with out lactose with warm water, and not with milk. As he attains 1 year you can try solid food,
To provide enough nutrients you can try giving boiled potato, apple etc.
If you are more particular of giving him milk you consult a pediatrician
for diagnosis and treatment , by treating with prebiotics
, post biotics, and enzymes they will try to make the gut suitable for lactose tolerable, As the age advances he can become elligible to take foods with lactose also.
Dont worry he will be fine, and thanks for calling.