Yes, loyaty mission's (even Legion's) count as a mission.
That said, after the IFF mission you can do 2 missions before your crew gets abducted. That gives you just enough missions to do Legion's loyaty mission and Tali's too (to which you can take Legion along for some extra dialog).
After the crew gets abducted it is said that you can do 1 mission before you start losing crew members... but to be honest, why take the chances?
Just do your loyalty missions before the IFF one, get Legion and then do his and Tali's mission. After that the crew goes away and you get them back. Everyone alive and happy.
Don't worry too much about side missions you could have left behind, after the suicide mission you can keep playing the game.
Take notice, you need to do all of the ship upgrades if you want to keep everyone alive after the suicide mission, if you miss even one then someone will die when you go through the relay.
If you don't mind reading up some minor spoilers on the suicide mission then read this wiki:
http://masseffect.wikia.com/wiki/Mass_Effect_2_Guide#Suicide_Mission
It will show you the right choices you need to make to keep your whole crew alive through that, there you will see who you should pick to escort your crew back to the Normandy once you find them in the Reaper ship.
SALUDOS!