Occupation does not necessarily mean the control of all of the territory, all of the time, at the same level of intensity. Many occupations meet with significant and active resistance while they are ongoing. Consider, for example, the US and UK-led occupation of Iraq. The strength of the insurgency there was such that at any given time these states lacked control over, say, some parts of the Sunni Triangle or some parts of Basra. That does not mean that their occupation of those parts of Iraq ceased, because the occupants were able to reestablish their control at will, as they did. The lapse in control was merely temporary, due to the fact that the level of resistance was such that the occupants could not control all of Iraq, every bit of it, all of the time.
Another well-known example is the German occupation of Yugoslavia during World War II. The partisans fighting against the Nazis were from time to time able to temporarily liberate a bit of territory here or there, but that did not mean that Germany’s occupation ceased. This was so because, as the military tribunal at Nuremberg ruled in United States v. List, ‘the Germans could at any time they desired assume physical control of any part’ of Yugoslavia. The ICTY in Naletilic likewise ruled that an occupation exists so long as the occupying army has the ‘capacity to send troops within a reasonable time to make the authority of the occupying power felt’ (a similar standard is set in the US Field Manual; see Shany’s article cited above, at 6, for the citations).