Question: how does spare the dying work?
Answer: As such, Spare the Dying works exactly as stated: You touch a living creature that has 0 hit points. Massive damage can kill you instantly. When damage reduces you to 0 hit points and there is damage remaining, you die if the remaining damage equals or exceeds your hit point maximum (PHB pg.