"that" has three functions:
i. it's a demonstrative pronoun; e.g.,
that book over there
ii. it's a relative pronoun; e.g., the book
that was on the table
iii. it's a conjunction; e.g.,
[1] the book (that)
I read
[3] It is this book (that)
I read yesterday.
[5] the boy (that)
I gave the book to
As a conjunction, "that" doesn't play a major role in the sentence structure (i.e., subject, object), and for that reason it's often omitted (...). "I", not "that", functions as the subject in [1], [3], and [5] above. "that" doesn't play a major role. Below, "who" and "whom" play a major role,
[2] the children
who came ... <subject of "came">
[6] the boy to
whom I gave the book <object of "to">
"who" and "whom" are required by the structure. "who" refers to the noun "the children", and "whom" refers to the noun "the boy". The conjunction "that" doesn't refer to a noun; it's a conjunction, a joiner.
Note that, with expletive "It" constructs, as in [4a] below, "who" sounds a tad bit awkward for some speakers because the grammatical subject "John" is referenced by two opposing pronouns: "It" (non-person) and "Who" (person):
[4a]
?It was
John who went to the park yesterday.
For some speakers, generic relative "that" solves the problem:
[4b]
It was
John that went to the park. <"that" functions as a subject, not as a conjunction>
All the best,