It's easy to confuse avant and devant because they both mean 'before' but it's simply a question of time or space:
(in front of)
Il arrive après Paul He arrives after Paul
J'arrive avant MarieI arrive before Marie
NB: A queue or line has both a sense of space and time so you can use both expressions (this is true in English too: "I'm in front of you / after you")
Tu es devant moi dans la queue.
Tu es avant moi dans la queue.You are in front of me in the queue.
You are before me in the queue.
NB: Sometimes in English you can use both 'before' and 'in front of' in a sense of space. In these cases in French, you can only use devant as it is the space-related preposition.
Mon frère est assis dans la rangée devant moi.My brother is sitting in the row before me.
My brother is sitting in the row in front of me.
Je me tiens devant lui.I stand before him.
I stand in front of him.
Compare this with the lesson Using dans, sur, sous, devant, derrière, entre to say in, on top of, under, in front of, behind, between (prepositions)
See also À + [heure] = At + [time] in French
and En vs Dans with time (French Prepositions of Time)
Want to make sure your French sounds confident?
We’ll map your knowledge and give you free lessons to focus on your
gaps and mistakes. Start your Braimap today »