Before as a preposition and a conjunction
As a conjunction before means ‘previously to the time when’. The conjunction before joins two clauses together. Note that before and its clause can come either before or after the other clause.
I always pray before I have dinner.
Before I have dinner, I always pray.
Note the use of the comma in the second structure.
He worked as an insurance agent before he went to the US.
Before he went to the US, he worked as an insurance agent.
In subordinate clauses introduced by before we use a present tense to refer to the future.
I will call you before I go. (NOT I will call you before I will go.)
Before as a preposition
As a preposition before means ‘earlier than’, ‘nearer the top’ and similar ideas.
Your name comes before mine on the list. (= Your name comes earlier than mine on the list.)
Before can also mean ‘in the presence of’.
He was brought before a judge.
Before and in front of
Before usually refers to time. In front of usually refers to place.
There is a temple in front of my house. (NOT There is a temple before my house.)
I must reach there before nine o’clock. (NOT I must reach there in front of nine o’clock.)
Both before and in front of can be used to talk about the order in which people or things come in queues, lists etc.
Do you mind? I was before / in front of you!