以前 means "before" when it is placed after an event or time ("before we ate" or "before 1 o'clock) . It means "ago" when it is placed after a duration of time. ("2 months ago"). 前 can also be used by itself.
I will come back before 6 o'clock.
Three days ago I was in Shanghai.
He got off work before 5 o'clock.