For the final choice, it's all based upon the characters relative 'defensive ability', it seems; some are high (Jacob, Garrus, Miranda, Grunt), others are low (Jack, Mordin, Tali, Legion). If you leave behind enough of the 'high values', you're more than likely going to ensure that those with them survive.
This link explains it well.
I didn't have Jack's loyalty, wanted the 75G for the achievement, and was really cagey about her dying so I ended up taking her with me at all points up to that part. At the final choice, I decided to have Mordin head back to the Normandy with the crew (cos he's squishy too, loyal or not) and then take Tali and Legion with me. Samara, Thane, Garrus, Grunt, Miranda, Jacob and Jack all stayed behind to hold the line, and it worked out.
Bookmarks