Why "it was him who" gets it wrong
What kind of error is it?

This is a grammatical error involving the misuse of a subject pronoun as an object, known as a case error.
Why do people make this mistake?
People often make this error because "him" is commonly used in everyday speech, and the sentence structure "it was him who" feels natural, though it's grammatically incorrect.
What is correct?
The correct form is "it was he who", using the subjective case "he" because it follows a linking verb.
Examples of correct usage
- It was he who completed the project.
- It was she who called yesterday.
- It was they who decided to leave early.