Coming back usually goes in this order: pain-free walking, then pain-free single-leg hopping, then a walk-run programme. Timelines depend a lot on the site of the fracture; some locations are higher risk. Follow your doctor’s plan.
Under-eating matters more than many runners realise. Low energy availability weakens bone over time. If stress fractures keep coming back, look at fuelling as well as training load.