I'm assuming you know the main story already, so *SPOILER WARNING* just in case.
When the IFF is installed, the next big event is the Collectors kidnapping your crew.
I don't know precisely when it happens, but the big indicator is when EDI says something along the lines of "the ship will need to remain on low power for the installation and testing", and then Shepard states that they'll use the shuttle.
Then there should be a cutscene of Shepard and crew boarding the shuttle and taking off.
The next cutscene is of Joker and EDI discussing the progress of the IFF, they discover it's transmitting the Normandy's location, Collectors board the ship, crew gets abducted, Joker and EDI space the invaders, and only Joker and EDI remain when Shepard and crew return.
After the cutscene/dialogue, you will have time to do exactly ONE mission without any crew perishing.
To clarify, your entire crew is abducted, but all are still alive. You do one mission, and your entire crew is still alive.
However, if you do more than one, crew members die, and the more missions you do after IFF installation and before storming the Collector Base, the more crew members perish, to the point that they could all be dead before you even arrive.
The "ideal" way to make this work is to put off the Derelict Reaper mission as much as you can, only doing recruitment and loyalty missions until your entire crew (as far as you can go) is on board and loyal.
Then do the Derelict Reaper mission, get Legion, talk to him to get his loyalty mission, and then do his loyalty mission.
The cutscene/Collector invasion should happen, then your ONE mission should be Legion's loyalty mission, and then it's off to the Collector Base.
Beat that mission to finish the main story, and then you can do things like Lair of the Shadow Broker and Arrival.
-------------
Long story short...
You don't get Legion until you complete the Derelict Reaper mission; and once you do that, the IFF is installed, Collectors invade, and the crew is abducted.
Funny story though, Legion was meant to be recruit-able mid-game. It was changed because it could interfere with the main plot, (i.e. someone recruits Legion right from the start, and now your crew is gone and all you have is Shepard at level 3 with a Predator pistol.)
Not fun.
If you edit the save to give yourself Legion early, he has fully-fledged dialogue in missions where it would be impossible to have him in the squad, since you haven't done the Derelict Reaper yet.
I know this is a long response, but I figured you should know what's what and why it is the way it is.
I wish I had better news for you, but what you're asking for is not possible.
To get Legion "early", you have to edit the save.
If you get him "normally" and do more than his loyalty mission, your crew will die; and the only way to "fix" that is to edit the save after beating the main story.
-------------
Put simply:
Maximum missions with Legion without save editing AND without sacrificing crew:
One (1)