As you know, the past tense forms of the verb TO BE are WAS (for I, he, she, it) and WERE (for you, we, they).
We were there.
John was here.
It was raining.
I was a student.
However, after IF (meaning "in case"), we must use WERE for all persons. That's called the Subjunctive Case and it's a mistake that even native speakers often make.
If we were there, we'd do it.
If John were here, he'd buy it.
If it were raining, we wouldn't have to do it.
If I were a student, I'd participate in the program.