This is the 991st most frequent German word.
em
"Em" is the dative form of "him" or "them" in colloquial German.
'dem' is the definite article in dative case, referring to a masculine singular noun (Jungen), indicating the relation 'with'. This usage reflects how 'dem' functions as a case occurrence in German.
Ich gehe mit dem Jungen in den Park.
I am going with the boy to the park.
'dem' here is part of the prepositional phrase following 'nach', requiring the dative case. 'Spiel' is a neuter noun, and 'dem' is its dative article.
Nach dem Spiel gingen wir nach Hause.
After the game we went home.
In 'vor dem Haus', 'dem' is the dative article for the neuter noun 'Haus', used after the preposition 'vor', which can govern either dative or accusative, here expressing location (hence dative).