I managed to get Legion loyal before you have to take the shuttle somewhere and the crew get captured. The only reason why Kely and some of the other crew members did not make it on mine was because I did side missions after it
From what I saw in my play through you can get Legion after retrieving the IFF and keeping him for yourself. Attempt this once you need to get 1 more member of the team. Once you do that, chat with Legion a bit first, attempt some loyalty missions and after a mission or 2, Legion to appear with his. The IFF shouldn't be ready yet anyway complete Legions Mission.
Also, attempt to be nice with Kelly, maybe that'll help.
Remember to send off the right combination to make sure the ships crew survive the trip back to the Normandy while you guys go on ahead.
I had Legion loyal, and I saved Kelly and the entire crew. I was not nice to Kelly beforehand; in my game she was never Kelly, only Yoeman Chambers.
The only way i can see you stuck on a trade between Legion's Loyalty, or Kelly's survival, is if you don't do Legion's loyalty mission until after the crew is captured by the Collectors. Kelly's death is due to not going after your crew immediately, and is unaffected by Legion's, or anyone else's loyalty.