IDF actions in response to Hamas attacks are not the same as permanent occupation of Gaza. Israel left Gaza in 2005 and Hamas has been in power ever since and has gleefully killed any Palestinians opposing them.