Purity: Positioning the Corpse Before and After Ghusl
Practical Laws of Islam as per the teachings of Ayatullah Sistani
Ruling 522:
It is better that until the ghusl given to a corpse has not been completely performed, a dying person should be laid in the manner mentioned in the previous ruling [with the soles of his feet] facing qibla. After a corpse has been given ghusl, it is better to lay it in the same position as it will be when people perform ṣalāt al‑mayyit for it.
-Ayatullah Sistani, Practical Laws of Islam, Purification (Taharah)


