There is actually a little more to it. I am assuming, Gil Galvanti, that you are asking about when to use who and that in relative clauses. There are 2 types of relative clauses, those that identify, known as identifying or defining relative clauses, and those that simply add more information, known as non-identifying or non-defining relative clauses. You can use "who" in both types but "that" in defining relative clauses only. examples:
1. She is the student who/that failed the test.
2. The winner was Ann Smith, who ran the race with an injury.
In the first sentence, if you remove the relative clause, the sentence makes no sense. "She is the student" tells us nothing, it doesn't "identify" anything. Thus, "who/that failed the test" is a defining relative clause. here, we can use who or that to refer to people.
In the second sentence, the relative clause "who ran the race with an injury" simply gives us additional information about Ann Smith. The sentence makes sence if you remove the clause: "the winner was Ann Smith." This type of relative clause is called non-defining and here, you cannot use "that" instead of "who."
I think this may help you: in non-defining relative clauses ( the ones that cannot use "that") there is usually a comma to separate the main clause from the relative clause. So if you see a comma, know that you can't use "that."
I hope that helped.