The Afghan government was sheltering al-Qaeda, which DID attack the US.
Iraq failed to dismantle all of their WMD stockpiles, despite plenty of time and warnings from the UN and US. They declared a chemical weapons stockpile in 2009, after the withdrawal agreement had already been signed.
America's involvement in Libya was limited to enforcing no-fly zones, which were intended to protect civilians.
The United States has not directly targeted the Syrian military or government forces.