'Who' is the subject and 'whom' is the object.
'Who' stands as the subject of a sentence, as in "Who is cooking lunch today?".
'Whom' stands as the object of a sentence, as in "A plagiarist is the one whom I despise."
Who/whom gives rule whereby he/him can be substituted for who/whom to check which is correct