I searched the internet for it and I found this.
Event-1 UNTIL Event-2 Event-1 continues up to the time when Event-2 begins. Event-1 BEFORE Event-2 Event-1 occurs prior to the time when Event-2 begins.
So, to make sure that I understand this fully, I made 2 right sentences and 2 wrong sentences. And I'd like to know if I've done a good job.
2 right sentences
Until you called me, I had been studying for about 3 hours.
Before you called me, I'd visited a store and bought some foods.
2 wrong sentences.
Until you called me, I'd visited a store and bought some foods.
Before you called me, I had been studying for about 3 hours.