Still the collateral damage needs to be proportional and adequate measures need to be taken to minimise civillian casualties.
So at least they would need to be able to evacuate. But Israel intentionally destroyed ambulances, cut water, electricity, fuel and communications, so it is impossible to evacuate the hospital. Israel did everything to make sure the civillian casualties will be high and that is nothing but a war crime and heinous murder.
https://www.newarab.com/news/israel-gives-hospitals-gaza-hours-evacuate
According to the Hamas propaganda Israel literally gave a one month head start on that demand when they did not control the area around the hospital.