What is the perfect squad status at the end of the game
Lots of spoilers here, so be warned.
Here's where you find everybody
Thane will die regardless due to his advanced Kepral's Syndrome. However there is a way you can avoid Thane's death but know that another character will die in his place (Video). You can view the details in the question, Can I change what happens to Thane?.
Mordin will die curing the genophage. I've heard that the only way around this is to not have Wrex survive Virmire, and also have the female Krogan die.
Miranda can die. Here's how to avoid it.
Legion will die. Either he's killed or he sacrifices himself. Tali can die in the same mission if you side with the Geth. You'll need to save the pacifist Quarian admiral, and have a high paragon to save her. I've also heard that you might have to have imported a loyal Tali from ME2 as well.
Samara can die as well. A high paragon and an interrupt saves her.
Grunt will die when you meet up with him if you try to save the Rachni Queen and he was not loyal from ME2.
Kaiden/Ashley can die when trying to save the council from Cerberus. Again, high paragon and an interrupt save him/her.