Can I take Legion on Tali's loyalty mission, complete all loyalty missions (including his), and still save my whole crew?

You can perform all the loyalty missions, take Legion on Tali's loyalty mission, and save your entire crew if you do the following:

  1. Do everything but Tali's loyalty mission.
  2. Do the mission to obtain the Reaper IFF.
  3. Do Tali's loyalty mission.
  4. Do Legion's loyalty mission.
  5. At this point, you should actually be out of things to do, and you'll be wondering why the Collectors haven't attacked yet. Go click your galaxy map. This should trigger the Collector invasion.
  6. Once it is over, go straight through the Omega IV relay. You don't have anything else left to do anyway!

I believe that you can make 3 jumps with the Normandy once you obtain the Reaper IFF before the collector attack. So it should be possible to obtain Legion, jump straight to Tali's loyalty mission, and then immediately do Legion's mission.

Once the crew is abducted, its uncertain how many more missions you can do before half the crew dies, but general consensus seems to be 1-3 missions.

This link seems to imply that its possible but just to be sure you should save before obtaining the Reaper IFF.