'before' - any time before now
Before means: at some unknown time before now. It does not say when. Therefore we would say:
We normally use the present perfect tense because the effect of meeting or seeing someone or being somewhere is still felt in the present. Simple past is also possible because we are talking about unknown occasions in the past, but it is less likely:
I know that chap. I've met him somewhere before.
Have you been here before? ~ No, I've never been here before. This is my first time.
'ago' - at a certain time before now
I know that chap. I met him somewhere before.
Were you here before? ~ No, I was never here before. This is my first time.
Ago tells us how long before the present time something happened. It tells us when and gives us a time or a date. Because we are referring to a specific time in the past, the simple past is used:
'before' - at a certain time before then
Your mother phoned five minutes ago. Can you phone her back?
I saw her for the first time at film festival in Cannes some twenty years ago.
Ago always counts back from the present time. Note that if we are counting back from a past time, before or earlier or previously are used, not ago:
'before' - conjunction and preposition as well as adverb
I met him at the AIDS conference in Durban in December 2002 when he told me that he had contracted AIDS four years before. ( = 6 years ago)
Last year I went back to my hometown that I had left ten years before and discovered that the house I grew up in was no longer standing. (= left home 11 years ago)
Last year I returned to my hometown that I had left ten years ago and discovered that the house I grew up in had been demolished (= left home 10 years ago)
Note that before can be used as a conjunction or preposition as well as an adverb.
If before is used as a conjunction, it often connects two clauses together which discuss past events. But note that it can also be used with a present tense in the subordinate clause to indicate future activity. Compare the following:
It can also link clauses denoting habitual current activity with the simple present:
They left the dining table before I had finished my meal. How rude of them!
He knelt down to say his prayers before he got into bed.
I shall read all the reports before I decide what action to take.
If before is used as a preposition, it usually refers to time, not to place when in front of is preferred. Compare the following:
I always shave before I take a shower.
You must take off your shoes before you enter the mosque.
To stay young and beautiful, try to get to bed before midnight each night.
To stay in shape, I try to go for a jog and a swim in the sea every morning before breakfast.
There were so many tall people in front of me that I could see nothing of the procession as it passed by.