How far along until baby is in 'safe zone' if he comes early?

Hayley • ~IT'S A GIRL!! 💕baby # 2 due May/June 2019~ 💙William Jack 17-08-17 💙
I'm having a boy and I'm almost 24 weeks. I've heard boys born prem are less likely to survive than girls and might have more developmental problems if they do 😔 I'm just wondering what week I can relax and know if baby comes early it will be okay and he will survive. I get heaps of braxton hicks so it's always on my mind. Thanks