Desecrating Shabbos on behalf of a Preemie:
Letter of law: If the baby’s hair or nails are not completely developed and it is questionable whether the baby was born in its eighth month, and certainly if one knows that it was born in the eighth month, then one may not desecrate Shabbos even for Rabbinical matters, even to help save this child. However, one may be lenient to move the baby, and some are accustomed to even circumcise the baby on Shabbos, although regarding circumcision it is better to abstain from doing so on Shabbos. If the child has complete hair and nails, or it does not but one knows for certain that it is a ninth- or seventh-month baby then Shabbos is to be desecrated to help save him.
Q&AMay one desecrate Shabbos to help save a test tube baby [IVF]? While the egg is in the stage of being fertilized in the tube one may not desecrate Shabbos to help save it, as only a fetus in its mother’s womb is considered a livable entity.
 Admur 330:8 “The above allowance applies by a livable baby, which is defined as a baby which was for certain born in the ninth [i.e. after the end of the 9th month, which is approximately after week 38 ] or seventh [month] (such as if the husband separated from her after [the original] marital relations [which got her pregnant]). However if the child was born in the eighth month, or if it is questionable whether it was born after seventh or eighth, then one does not desecrate Shabbos for him whether for the above matters, whether for matters which lack of performing can endanger him, such as to undo a mound that is over him, unless his hair and nails have completed growing, in which case he certainly was fully developed by the seventh months and it just delayed leaving his mother’s womb after having been fully developed. Therefore, even if he is for certain born in the eighth, such as if her husband separated from her after having marital relations, his status is like one who was born in the seventh month for all matters and he is [thus] to be circumcised on Shabbos. However, if his hair was smitten and his nails are not complete as [are to be] when born, then even if he is questionably a child of the eighth month, his ruling is like one who is for certain of the eighth month for all matters. Furthermore even regarding life threatening matters in which one [is ordinarily allowed to] desecrate [even] when there is a doubt, even by a fetus which never had a living status due that we suspect that perhaps he has developed enough months and his hair and nails are complete, nevertheless here where we see that [his nails and hair] are not complete it is close to certain that he was born in the eighth [month], [and he] would not have been complete until the ninth month, and he hurried to be born prior to the time and he is a stillborn. Even to move such a baby is forbidden the same way it is forbidden to move a stone. Therefore, one does not circumcise this child on Shabbos. We do not say let us circumcise the child in any event as if the child is a seventh month old then his circumcision overrules Shabbos and if he is an eighth month child then there is no Shabbos desecration here in the circumcision, as it is like merely cutting meat. [The reason for this is] as since it is close to certain that it is an eighth month child the Sages did not want to allow moving him on behalf of his circumcision in a scenario where it is close to certain that his circumcision is meaningless. There are those who argue on this and say that since it is possible that he is a seventh month child and all seventh month children are not stillborn despite that their hair and nails have not fully developed, therefore there is no prohibition at all to carry him on Shabbos, and so too he is to be circumcised on Shabbos in any event. However, one may not desecrate Shabbos for him according to all whether for matters in which there is danger [for the child] if they are not done, whether for matters that [the Sages] permitted to do for the child on the day that he was born due to his pain even though that [doing these actions] do not contain a Biblical prohibition. Based on this [latter] opinion today we circumcise all children even if he was born in the eighth month as we are not expert in the months of pregnancy as at times a woman conceives near her immersion and at times she does not conceive until later and it is possible that the child is a seventh month child, and even though that his hair and nails have not fully developed he is to be circumcised, and so too it is permitted to move him on Shabbos. (Regarding the final ruling in a Rabbinical matter one follows the lenient opinion and therefore one who is lenient to move the child like the latter opinion does not lose [following religious law], however with regards to circumcision on Shabbos it is better to sit and do nothing, as it is proper to suspect for the words of the forbidding opinions, [as] although there is no prohibition in moving the child there is a prohibition in circumcising the child on Shabbos for no need as similarly there is a prohibition in cutting the umbilical cord on Shabbos even according to the latter opinion as was explained [above].) “
 To note in 331:3 Admur writes plainly that he may not be circumcised on Shabbos.
 Chazon Ish 155:2; Minchas Yitzchak 4:123; Shevet Halevi 3:141; Kinyan Torah 3:42; Chazon Ish Yoreh Deah 155; Piskeiy Teshuvos 330:8; Nitei Gavriel 60:7; Toras Hayoledes 61
Chilul Shabbos for a baby born with severe medical issues: See Nishmas Avraham 4:330-3; Piskeiy Teshuvos 330:8
 The reason: As today we have incubators and other forms of technology which highly raise the child’s ability of survival and it is thus no longer considered like a stillborn. [Poskim ibid]
 Piskeiy Teshuvos 330:9
 So rules Sheivet Halevy 5:47