How should a dying person be positioned?
The answer
It is sunnah to make a dying person face the Qiblah whilst being positioned on his right side. However, it is also permissible to make him/her rest on their back with their feet facing the Qiblah. In such a situation, the head should be elevated on a pillow and faced towards the Qiblah.
In short: it is sunnah to lay the dying person on the right side facing the qiblah; lying on the back with feet towards the qiblah is also permissible.
Explanation
If the above two are difficult, then it is permissible to leave the dying person in whichever position is comfortable for them. 1
And Allah knows best.
Mufti Faraz Adam
References
1قَالَ رَحمَه الله إِذا احْتضرَ الرجل الْمَوْت فَإِنَّهُ يُوَجه على شقَّه الْأَيْمن نَحْو الْقبْلَة (تحفة الفقهاء ج 1 ص 239 دار الكتب)
إذَا اُحْتُضِرَ الرَّجُلُ وُجِّهَ إلَى الْقِبْلَةِ على شِقِّهِ الْأَيْمَنِ وهو السُّنَّةُ كَذَا في الْهِدَايَةِ (الفتاوى الهندية ج 1 ص 157 الرشيدية)
(يُوَجَّهُ الْمُحْتَضَرُ) وَعَلَامَتُهُ اسْتِرْخَاءُ قَدَمَيْهِ، وَاعْوِجَاجُ مَنْخَرِهِ وَانْخِسَافُ صُدْغَيْهِ (الْقِبْلَةَ) عَلَى يَمِينِهِ هُوَ السُّنَّةُ (وَجَازَ الِاسْتِلْقَاءُ) عَلَى ظَهْرِهِ (وَقَدَمَاهُ إلَيْهَا) وَهُوَ الْمُعْتَادُ فِي زَمَانِنَا (وَ) لَكِنْ (يُرْفَعُ رَأْسُهُ قَلِيلًا) لِيَتَوَجَّهَ لِلْقِبْلَةِ (وَقِيلَ يُوضَعُ كَمَا تَيَسَّرَ عَلَى الْأَصَحِّ) صَحَّحَهُ فِي الْمُبْتَغَى (وَإِنْ شُقَّ عَلَيْهِ تُرِكَ عَلَى حَالِهِ) (الدر المختار من حاشية ابن عابدين ج 2 ص 189 أيج أيم سعيد)
Based on the Hanafi school and on the question as it was asked. Another mufti may reach a different conclusion. Read the disclaimer.