Ich gebe dem Mann das Buch. I give the man the book. Two nouns in a sentence - dative before accusative Ich gebe es dem Mann. I give it to the man. One noun, one pronoun in a sentence - pronoun ...
If dual-case prepositions describe movement from one place to another, they are followed by the accusative case. Otherwise, they take the dative. Ich stecke die Schuhe unter das Bett.