In short, whenever the information is essential to identifying the subject, the proper pronoun to use is that. If the information is not essential, or can be set apart with commas, then the pronoun which is more likely to be correct. As is the case with English grammar rules, however, there are going to be some exceptions to this rule. When in doubt, writers can try removing the relative clause and asking themselves if the sentence sounds complete and informative. Some grammar experts suggest silently adding the words "by the way" after which to determine if the information is relevant or irrelevant. If "by the way" seems to fit, then the clause is non-restrictive and should be set off with commas.
SEX. The physical difference between male and female in animals.
2. In the human species the male is called man, (.) and the female, woman. (.) Some human beings whose sexual organs are somewhat imperfect, have acquired the name of hermaphrodite. (.)
3. In the civil state the sex creates a difference among individuals. Women cannot generally be elected or appointed to offices or service in public capacities. In this our law agrees with that of other nations. The civil law excluded women from all offices civil or public: Faemintae ab omnibus officiis civilibus vel publicis remotae sunt. Dig. 50, 17, 2. The principal reason of this exclusion is to encourage that modesty which is natural to the female sex, and which renders them unqualified to mix and contend with men; the pretended weakness of the sex is not probably the true reason. Poth. Des Personnes, tit. 5; Wood's Inst. 12; Civ. Code of Louis. art. 24; 1 Beck's Med. Juris. 94. Vide Gender; Male; Man; Women; Worthiest of blood.