Man kann über das Gebäude sehen.
Man kann über dem Gebäude sehen.
I'm not sure if „über“ is accusative or dative in this sentence, please help and please explain why it is dative/accusative. Thank you!
The standard rule is always the same:
So, when you see a balloon hovering above a building, then you are looking at a place above the building, and then you need dative case:
Ich sehe den Ballon über dem Gebäude.
I see the balloon above the building.
But but if you are on a hill near the building, on a place higher than the roof of the building, and you look at something behind the building, then your view "moves" over the building, so we have a direction and therefore we need accusative case:
Ich kann über das Gebäude sehen.
I can see over the building.
In the first sentence, "Man kann über das Gebäude sehen" (You can look over the building), you can ask "Über wen kann man sehen?", which indicates that the accusative is used here.
In the second sentence, "Man kann über dem Gebäude sehen", you can ask "Über wem kann man (etwas) sehen", indicating the dative. Note, that this second sentence doesn't make entirely sense. In its current way, it would mean that once you are above the building, you are able to see. There would be more sense to it if the sentence was "Man kann etwas über dem Gebäude sehen" (you cann see something above the building). In this case, "dem Gebäude" is dative, "etwas" is accusative.
It just depends on the meaning. "über jemanden sehen" means you look over somebody, "etwas über jemandem sehen", you see something above somebody.