Under what circumstances is ecmo used for newborns? When is ecmo used, and how long do babies typically need it for?

Many conditions. There are many conditions for which ecmo is used. Some of the more common ones are very low oxygen levels due to immature lungs or meconium aspiration (when baby inhales their own poop before they are born) or heart disease from abnormal anatomy/development.