The US fought in urban settings in Iraq without putting civilian populations under siege and starvation. By all appearances, Israel isn't even trying to conduct a lawful urban war.
Israel started by dropping bombs on hundreds of sleeping families, leveling entire neighborhoods and after a month of that, started fighting some ragtag scavenger fighters (non-state actor), who have almost no external support, while continuing to level everything remotely related to governance, culture, or other social institutions that came in their path for seemingly no reason but the desire to completely erase possiblity for Palestinians to live in Gaza.
Seems more like an extermination campaign, and no, you can't fight that lawfully.