It were/was they/them who did that.
There are 4 possible variations of this sentence - but grammatically correct obviously only one. Which is the right way to say this sentence and others alike?
Less than four. The subject "it" requires only "was" here (being a singular pronoun) having no connection with conditional sentence.
So the rest are
It was them/they who did that.
Most people say "It was them".
A couple of centuries ago, some grammarians made up rules to make English more like Latin (and sell more grammar books), and taught people that it should be "It was they": generations of teachers have taught that form, and some people still say it.