Increased us/coalition involvement was pretty much the reason is' advances stopped in northern syria about a year and a half ago. Russia sent in the clones in September, IS has been consistently losing territory on every front in syria ever since. Kurdish forces/Rojava aren't going anywhere, theyre nato backed and friendly/nonconflicting with russian interests, they will likely have de facto autonomy in whichever state they're a part of when the dust settles. The only pending question is who, between the saa/hezbollah/Ba'athist Alawite particularist Assad government, the Islamist rebel groups -JaN, Jaish al-Fatah, Ahrar ash-Sham, whatevers left of the FSA- and the us-supported SDF/YPG, can carve out the most territory and political capital before people start taking peace talks seriously. So, years.
I can't speak for iraq, to my knowledge all IS controls is al-anbar?