so we would turn away from them and seek Allah’s forgiveness.” (1)
The Prophet’s statement, peace and blessings be upon him, “Do not face it, nor turn your backs to it,” is a prohibition, and the basic principle regarding a prohibition is that it denotes forbiddance.
The hadith indicates that a slight deviation is insufficient, for he said, “Rather, turn east or west,” which requires a complete turn away. However, “turn east or west” applies to people for whom turning east or west does not entail facing the qiblah or turning their backs to it, such as the people of Madinah: their qiblah lies to the south, so that when they turn east or west, the qiblah is either to their right or to their left. But if people turn east or west and thereby face the qiblah, then they must turn northward or southward.
As for the underlying reason, it is to show reverence for the qiblah by neither facing it nor turning one’s back to it.
Outside a built structure …
His statement, “outside a built structure,” is an exception; that is, if one is within a built structure, it is permissible to face the qiblah or turn one’s back to it. This is based on the hadith of Ibn Umar, may Allah be pleased with him and his father, who said: “One day I climbed onto the house of my sister Hafsah and saw the Prophet, peace and blessings be upon him, relieving himself while facing Syria and with his back toward the Ka‘bah.” (2)
This is the well-known position of the madhhab. Indeed, they said that a barrier is sufficient even if it is not a built structure—for example, if one positions himself behind a mound of sand that he has raised, or behind a tree, and the like. (3)