I had a fistula; so I asked the prophet ﷺ. He said: offer prayer in standing condition; if you are unable to do so, then in sitting condition: if you are then at your side(i.e, in lying condition). (Using translation from Abū Dāʾūd 952)
كَانَ بِي النَّاصُورُ فَسَأَلْتُ رَسُولَ اللَّهِ ﷺ فَقَالَ «صَلِّ قَائِمًا فَإِنْ لَمْ تَسْتَطِعْ فَجَالِسًا فَإِنْ لَمْ تَسْتَطِعْ فَعَلَى جَنْبٍ»