You can consider the phrase "in front of" to be a compound word.
Compound nouns are quite common: "car park" is a compound noun. They formed by joining some words (in this case nouns) together. Originally a "car park" was a park (=a public open space) for cars. But the words have grown together, and now "car park" acts like a single word with its own specific meaning.
Similarly the phrase "in front of" must have developed out of the combination "in (preposition) front (noun) of (preposition)". But the words have grown together, and the phrase "in front of" now acts like a single word with a specific meaning, and one that functions like a preposition.
So each word has a part of speech, but "in front of" is one word, from a certain point of view.