And yet, the rule exists. If you use “to be” in a conditional sentence, you have to use “were”, even when the subject of the clause is a third-person singular subject.
In counterfactuals, not conditionals.
If he were there, I would have seen him. (Counterfactual subjunctive.)
If he was there, I didn’t see him. (Conditional indicative.)
If he were here, I could see him
If he is here, he’s invisible.