If the tank crew shot first, the crew would not have been out of the tank on foot. But it is a rule of engagement that tanks do not fire in areas where civiliams (non-combatants) may be. Contrast this to terrorists who specifically target civilians.
Supreme Court rejects plea for freeze on expansion of asylum seekers' detention (Haaretz)
from the article: IDF soldier killed by friendly fire on Gaza border