Where the schools genuinely differ
This is the most consequential fiqh in the whole subject, because parents are deciding about a body inside a day and usually with nobody telling them anything. This platform is not going to rule on it. It is going to show you the shape of the disagreement so that you know what to ask.
One position, held by a number of contemporary authorities, is that from four months the child is named, washed, shrouded, prayed over and buried among the Muslims, and some hold that the aqiqah is performed.
A different position, set out in the Shafi'i school, distinguishes further. Before four months, burial only, with no funeral rites obligatory. After four months and before six, the washing, shrouding and burial become obligatory but the funeral prayer is held to be unlawful. After six months with no sign of life there is internal disagreement, with Ibn Hajar holding the prayer remains unlawful and Ramli holding it becomes obligatory. Any sign of life at any stage means full rites, and on that there is agreement.
Read that again and notice how far apart those are. Under one position a parent is told the janazah prayer is obligatory for a twenty week loss. Under another they are told it is unlawful. Anyone who tells you flatly what the ruling is, without asking which school you follow, is telling you their answer rather than the answer.
So take it to your own scholar, or to your local burial service, who deal with this every week.
What does not differ, and what you can hold now: burial with dignity is due, dua for the child and for the parents is due, and grief is not a deficiency in your faith.