Oh boy!
First of all, it wasn't Iran VS Iraq, it was Iran VS Iraq+U.S+Soviets+Arabs, Iran captured soldiers from 17 different countries in that war, you all couldn't defeat Iran.
secondly, U.S fought no one in Iraq, specially the second war, Iraqi troops surrounded with no resistance, Saddam had no more foreign troops, no more foreign money, no more foreign weapons, no more foreign intelligence, plus all of the sanctions and Saddam's foolishness to allow U.S spies to freely run through out entire country (whether before or after war), just look how much it took for U.S to recapture just one city from ISIS in Syria or Iraq.