Does Islam condone terrorism?

In war, the targeting of innocent non-combatants is a despicable act which Islam clearly prohibits. In fact, Muslims are not even allowed to destroy plants and animals unnecessarily, let alone innocent humans. This is just but one example of many ethical guidelines of war stipulated in Islam. However, it is important to distinguish between terrorism and legitimate resistance to occupation, as the two are very different.