Okay, here's what you do.
First, get everybody's loyalty. I don't know if you NEED all of them, but it helps.
Second, get the three ship upgrades (Shield, Hull, and Cannon from Tali, Jacob, and Garrus respectively)
Third, the execution, here's what you do:
Round 1:
Leader: Jacob/Miranda/Garrus
Specialist: Tali/Legion
Round 2:
Leader: Jacob/Miranda/Garrus
Specialist: Samara/Morinth/Jack
Escourt Duty: Anyone Loyal (I suggest Mordin, because he has a HIGH chance of dying at the last part.
Round 3:
Team: Any two loyal teammates (I suggest Jack and Tali, try not to take Grunt or Garrus, or god forbid, both).
Here's the reasoning behind the Team and Escourt Selections.
At the last part while fighting the reaper, your team is "Holding the Line". Each member of your team has a score related to this, which is increased if they're loyal. Now, the three who have the lowest scores here are, you guessed it, Tali, Jack, and Mordin, with Mordin being the lowest. Garrus and Grunt have the highest. So, if your team (The guys you left behind) don't have their score exceed a certain number, the guy with the lowest score dies, usually Mordin if he's there. So, if you leave the toughies (Garrus and Grunt) and take the softies (Tali and Jack), everyone will survive!