This is a matter of formality. In more colloquial English, we can say:
- It's him who said that
- It's them who did it, not me
- It's us who need to go, not you
Whereas in formal English, and in an exam, you would use
- It is he who said that
- It is they who did it, not I
- It is we who must go, not you
This is actually more complicated than it seems, because the level of formality depends on the specific structure in which the pronouns are embedded (here, cleft sentences). In this case, though the nominative-case pronouns are technically correct in the cleft sentences, they sound very formal.