The US won't pull out of the middle east until the oil is drained.
Or until we run out of money, like the Soviet Union.
There's a huge difference between how we're dealing with the situation vs how the USSR tried it. They went the most expensive route - first by supplying services and arms to puppet regimes, and then bringing in a huge military machine for a long term occupation. On top of that, they didn't have much of a global demand for their goods - other than weapons - and so, couldn't stockpile enough cash to make that work.
Our position so far has been to soften the opposition with short term invasions, and then train the indigenous people to stand up for themselves. As we pull out completely, we throw a few bucks their way to "buy" a stable support base for the long term. This allows us to keep our costs a little lower, and paves the way for setting up global trading partners and other diplomatic benefits.
The USSR wanted to either annex or control the countries it invaded. Our goal in all of that was to string out the USSR, break it's economy, and topple Communism. The US won't pull out of that region for a couple of reasons - one is the strategic positioning we've gained overlooking both Europe and Asia, and the second is to maintain the free flow of oil to the world which keeps the world economy from tanking.