In our class we are taught an important concept for A2.1 level called ‘wechsel präpositionen‘.
In Deutsch there are certain prepositions which take Akkusativ case always and there are certain prepositions which take Dativ case always. And there are some prepositions which can take either Akkusative or Dativ.
The prepositions which take either Dativ or Akkusativ are called wechsel präpositionen. They are as in the below picture.
As the picture shows if you can frame a question as ‘Wo‘ meaning ‘Where‘ for a given statement then that statement is supposed to be in Dativ.
If you can frame the question as ‘Wohin‘ meaning ‘Where to‘ for a given statement then that statement is supposed to be in Akkusativ.
There are 3 verbs namely geben, stellen, legen which will take Akkusativ. And the corresponding verbs bleiben, stehen, liegen will take Dativ.