Conventions of Composition Rule 131
Rule: Because that begins essential clauses, that is not preceded by a comma. Which begins inessential clauses, so which is always preceded by a comma. The relative which is generally neuter in modern usage, so confine its use to animals, ideas, and things, and to collective nouns such as crowd, mob, army, etc. Who begins any clause, essential (uses no comma) or inessential (separate with a comma), referring to a person. If you're using one of these words as the object of a preposition, even if it begins an essential clause, use which.
Examples:
Correct: The beggars whom [not which] we see in the streets are hungry.
Correct: I know that Kerry has more than six puppies at home.
Correct: The puppies, which are a mix of Bernese Mountain Dog and Poodle, are adorable.
Correct: The doors through which the students enter the dining hall had a broken window.
Practice deciding which relative pronoun and punctuation these sentences need:
Kendall wants a boyfriend (that, which, who, whom) knows how to dance salsa and fix an engine.
I like any car (that, which, who, whom) can go more than 550 miles on one tank of gas.
Alex's feelings on the subject (that, which, who, whom) haven't changed at all remain on the list of demands.
Resources for further explanation of relative pronouns:
Grammar Girl's Podcast 997, starting at 1:32
Grammar Book's Who, That, Which
The Writer's Digest Which vs. That