Drs. generally require a 4y bachelor's degree , 4 years of medical school, and 5 to 7 years of neonatal residency.
Nurses require at least a 2y Associate Degree in Nursing (ADN) and a 4y Bachelor of Science in Nursing (BSN) degree often required. Masters degrees are also offered and command higher pay as well as increased responsibilities.
There's also a https://onlinenursing.baylor.edu/news/importance-being-neonatal-nurse-practitioner degree option that 2-3 years post BSN or MSN degree.
In general, the Drs. would develop treatment plans for newborns and the nurses would help carry those out. Drs. prescribe medication and nurses would dispense them. Nurse practitioners are more like Drs and can prescribe some medication and do some treatment plans. https://www.registerednursing.org/articles/whats-difference-nnp-neonatologist/ has more details.