The US and its followers are the illegal invaders; the Iraqis were not attacking anyone.
Other foreign states who sent troops to help the US in Iraq were
violating the most basic of all international laws,
the law against wars of aggression in the UN charter.
It is illegal to just go into someone else's country
and start killing the citizens there, and it is illegal regardless of whether the citizens there
resist your illegal presence.
If someone came and invaded the US, it would be illegal for them to kill US citizens in the US,
and if some of the US citizens decided to fight back, this would not make it legal to kill them.
According to international law,
it is not a crime to violently resist a foreign occupation of a country, and it is a crime to
carry out one.