Were done so in a defensive war. The UN never called for complete withdrawal.it called for withdrawal to borders that ensure Israel's security. your generalities about illegality are simply untrue, but they do sound catchy don't they.
Jerusalem suburb of Even Sapir evacuated as wildfire spreads (Haaretz)
from the article: Palestinians plan UN resolution calling for settlement evacuation