Normally — meaning under the most usual readings — the first one would be wrong and the second right. There is a way to read it that makes the first one also correct, but it is a rare reading. Because English doesn’t have its notional tenses clearly marked as inflectional ones, I’m going to change the verb to be, which is the only place the distinction can be seen in the orthrography.
- If I was at home, I ate dinner by five o’clock, but if I was at work, I never ate before seven o’clock.
- If I were at home, I wouldn’t have to drive after dinner.
The difference is that in the first sentence, there is no question that the verb in the if clause is in the indicative. In fact, there you can change out the two instances of if for when or even whenever, because it represents customary or repetitive action. If this were a Romance language, one would use an imperfect tense not a perfect one, because the action in the if clause is continuous, not completed.
In the second sentence, the mode of the verb shifts into fantasy-land. It is a hypothetical. It no longer takes an indicative mode, but rather (in Romance terms, at least), a (past-)subjunctive one. And the corresponding then clause now takes a conditional tense.
Although some people don’t like applying terms derived from Romance sequence of tenses to English, I think it can help clarify things. Just because you don’t have a visible inflection in most cases doesn’t mean that it is not a ‘tense’ or ‘mood’; those concepts do not require an orthographic shift in the verb’s inflection to have the sense of the clause shift from known, real, and true to some other situation.
You can make the sentences more complex by shifting the verbs into perfect tenses, but the essential indicative-vs-subjunctive nature, or if you must, real vs unreal, remains.
- If I was at home that night, I must have eaten alone.
- If I had been at home that night, I would have eaten alone.
Here it is becoming less clear, but the same distinction still applies. One final possibility, which is the rare one, I think, is when both clauses are in the simple past indicative. Because English doesn’t distinguish completed action as clearly as Romance languages do, this can be a bit fuzzy to look at, but the idea is the same.
- If I was at home, the office was dark.
- If I ate early, you ate early.
- If I called you, you answered right away.
- If I gave you grief, you gave me cheers.
- If I am at home, I always have a snack around o’clock.
- If I am at home, I answer my own calls.
- If I am at home, I will take out the trash before the garbage trucks arrive.
- If he has shown up early, I shall not be pleased.
- If he has shown up early, he can’t come in.
- If he has shown up hearly, I’m leaving.
- If I put down the pencil, will you stop nagging me?
None of those has any subjunctive or conditional in either clause. Even the last one has (what a classicist would call) the present perfect in the first clause and the future perfect in the other, but they are both still indicatives of one sort or another, not subjunctive or conditional. These, in contrast, are not:
- If I were you, I would say nothing.
- If I called, would you answer?
- If I had called, would you have answered?
- If I put down the pencil, work would grind to halt.
- If I had put down the pencil, work would have ground to a halt.
- Unless it were for a good cause, I would not donate my time and energy.
The only time you still have a mix of indicative and subjunctive is with a lest clause, which still demands a subjunctive mood in English.
- He will say nothing at all, lest it be misconstrued as criticism.