Almost every building does not keep the shell of the tank. It passes through it. If someone tries to use the house as a cover, it will not save from destruction.
If you are stopped for a building, but were already in sight, you will not be saved.
It works at any distance from the building.
https://www.youtube.com/watch?v=TUSwxR1Ixug&feature=youtu.be
https://www.youtube.com/watch?v=i1PZ-PPjGAE&feature=youtu.be
https://www.youtube.com/watch?v=YPfXa8d7HNY&feature=youtu.be