One shouldn't take the international legal criteria literally; instead, the effective reality must be considered. They are ineffective. International law should exclude wars, but since its inception, there have been dozens—hundreds, I'd say—of wars.
If there's now a war in Palestine and another in Ukraine, it's because the UN in reality guarantees neither the Israelis nor the Palestinians, nor the Ukrainians nor the Russians.