The word Deen, is an arabic word with three general sentences, judgment, custom and religion while the word Dunya is an islamic word which refers to the temporal world, aka the world before the afterlife. The meaning behind the sentence "Deen over Dunya" means that we Muslims put our religion over this temporary world which we believes is a test from our
God.
Let's say that a
muslim is invited to a haram party, needs to wear
something revealing to a specific place they have to go to or feel like having to skip a prayer for something so
stupid yet important. A good
muslim would put the Deen over Dunya in a position like this - with other words, not take the so called haram option cause it's not worth the take.
Muslims believe that this world is temporary and is just a test from
God. This is NOT the real world, and when we fall into a position where we have two options to take, it is
God that tests us. That's why we put our religion first, which is much more important, over this temporal world.
Non
Muslim friend: I know you can't eat
pork, but c'mon, just try a bite! Please?
Halal
Muslim: No, Deen over Dunya.