The answer is fairly easy. John McCain would stay until the job is done all the way and security is accomplished for a more permanent nature.
Barrack Obama would leave in 16 months giving the terrorist organizations a published timetable to plan for so they know how long they have to retrain new recruits, and stockpile weapons. Barrack thinks we should have never entered into the fight and free the people that were being killed in a wide variety of ways by a terrible oppressive leader. Saddam Hussein was the man in charge and was responsible for killing so many people when his country was given the chance they had him killed by hanging by the neck till dead.
Barrack wants to just leave the country and any problems there to Iraqi folks, not realizing that the problems they have are ours as well since we do not live by ourselves in the world.
With this it is easy to be confused as Obama does not have any experience in international affairs, but wants to demonstrate he knows what is going on by creating a situation that only benefits terrorists.