4.5 months old child having loose motion and vomitings.if this child is bottle fed then this could be starting of a tummy infection.
Watch for urine output.if child passing urine every 4 hrly or so then his hydration level is ok otherwise give oral rehydration solution or ORS which is available in market start syrup ondem 2.5 ml two times a day empty stomach.and add an antacid like rentac syrup 2.5 ml two times a day .Add a probiotic like enterogermina three times a day.and your child would be better as in this age most episodes of loose motions are viral and would take 7 days to settle.
Maintain hygiene.use katori Camacho for top feeds and avoid a bottle.
Then teething- you are right .He seems to be having teething issues.Loose motions around time of teething occur as the child continues to put his hands in his mouth which causes infection.so please clean hands more often and keep the child's surroundings clean.
Yellow flakes on scalp .It would have been better if I would have seen a pic but as you described it looks like cradle cap that's a fungal infection of scalp just add 5 drops of momate lotion and add candid lotion to it massage it in scalp for 2 weeks 2 times a day and that should help.
Next Steps
get
stool routine microscopy and reducing substance send report.
Health Tips
ORS is the best treatment for loose stools .avoid antibiotics unless advised by your pediatrics.