Guideline On What Constitutes Straightening Back In Salah
Question

Is salah invalid if we do not keep our back straight?
Praise be to Allah.Maintaining a straight back in Salah (formal prayer) is required in three positions:
The first position: (During standing) i.e., after the opening Takbir (Takbirat Al-Ihram).
Jurists have differed regarding the manner of standing. The Hanafis and Hanbalis say that one should stand in such a way that if they were to extend their hands, they would not reach their knees.
It is stated in "Al-Jawharah An-Nayyirah" (1/50): "The limit of standing is such that if one extends their hands, they would not reach their knees." End quote.
See: "Al-Bahr Ar-Raiq" (1/308), "Hashiyah Ibn `Abidin" (1/444), "Sharh Muntaha Al-Iradat" (1/194), and "Al-Insaf fi Ma`rifat Al-Khilaf" (3/480).
The Malikis and Shafi`is say: If one leans forward to the extent that they are closer to bowing than to standing, their Salah is invalidated.
An-Nawawi said in "Al-Majmu`" (3/261): "The required straightness is the straightness of the spinal column. It is not permissible for one who is able to stand (straight) to lean to one side, deviating from the norms of standing, nor to stand bent as if in the position of those bowing; if the bending does not reach the extent of bowing but is closer to it, there are two views: the most correct of which is that their Salah is not valid because they are not standing straight. The second view is that it is valid because it is close to the required posture. If one lowers their head without bending, their Salah is valid without dispute because they are standing straight." End quote. Also see: "At-Taj wal-Iklil" (1/419).
Therefore, if the person praying bends and their bending is closer to bowing without an excuse, their Salah is invalidated according to the Malikis and Shafi`is.
According to the Hanafis and Hanbalis, it is not invalidated unless it reaches the extent of bowing.
The second and third positions: (During straightening up) i.e., from bowing and prostration.
There is a Hadith from Abu Mas`ud Al-Badri, who said: The Messenger of Allah (peace and blessings be upon him) said: "A man's Salah is not valid until he straightens his back in bowing and prostration." Reported by Abu Dawud (855), At-Tirmidhi (265) who said it is sound and authentic, An-Nasa’i (1027), and Ibn Majah (870).
Imam At-Tirmidhi (may Allah have mercy on him) said:
The practice of the scholars from among the Companions of the Prophet (peace and blessings be upon him) and those after them is upon this, as they believe that a man should straighten his spine in bowing and prostration.
Ash-Shafi`i, Ahmad, and Ishaq said: Whoever does not straighten their spine in bowing and prostration, their Salah is invalid due to the Hadith of the Prophet (peace and blessings be upon him): "A Salah is not valid if a man does not straighten his spine in bowing and prostration." "Sunan At-Tirmidhi" (2/51).
It is also reported in "Musnad Ahmad" (10799) from Abu Hurairah that the Messenger of Allah (peace and blessings be upon him) said: "Allah does not look at the Salah of a man who does not straighten his spine between his bowing and prostration."
Shaykh Al-Islam Ibn Taymiyah said in "Majmu` Al-Fatawa" (22/534):
"This is explicit in that Salah is not valid until a man straightens up from bowing and stands straight from prostration; this indicates the obligation of straightening up in bowing and prostration...
That is because his statement (to straighten his back in bowing and prostration) means: when raising his head from them; for straightening the back is part of the completion of bowing and prostration; because when he bows, the bowing is from the moment he bends until he returns and straightens up, and prostration is from the moment of falling from standing or sitting until he returns and straightens up.
The lowering and raising are the ends and completion of bowing and prostration; therefore, he said: (to straighten his spine in bowing and prostration)."
And this shows that the obligation of this straightening is like the obligation of completing bowing and prostration." End quote.
It is narrated from Abu Wail, from Hudhayfah, that he saw a man who did not complete his bowing and prostration, so when he finished his Salah, Hudhayfah said to him: "You have not prayed," and I think he also said: "If you were to die, you would die not following the Sunnah of Muhammad (peace and blessings be upon him)." Reported by Al-Bukhari (382).
In another narration (758), from Zaid bin Wahb, he said: Hudhayfah saw a man who did not complete the bowing and prostration, he said: "You have not prayed, and if you were to die, you would not die upon the natural disposition that Allah created Muhammad (peace and blessings be upon him) upon."
The limit of straightening up from bowing here is the same as the limit of straightening up from standing after the opening Takbir.
It is stated in "At-Taj wal-Iklil" (1/419):
"In At-Talqin: Among the pillars of Salah is raising from bowing.
There is a difference of opinion regarding straightening up in standing from it, and the preferred opinion is that it is obligatory to the extent that it is closer to standing, and likewise in the sitting between the two prostrations." End quote.
Al-Talqin is a book on the Maliki school by the judge `Abdul Wahhab (may Allah have mercy on him), one of the prominent figures of the Maliki school.
As for bending during the Tashahhud (testimony of faith) or sitting between the two prostrations, Ibn Hajar Al-Haytami, a Shafi`i scholar, mentioned in Tuhfat Al-Muhtaj (2/150) that if the one sitting bends to the extent that their forehead is level with their knees, their Salah is invalidated.
Ash-Sharwani (may Allah have mercy on him) commented on this by saying: "This is debatable": ... then he mentioned that some Shafi`i scholars disagreed with Ibn Hajar on this.
What is appropriate for the person praying is not to bend in their sitting to the extent that their forehead goes beyond their knees, but if they do bend, it should be less than that.
In conclusion: If the person praying bends during standing to the extent that it reaches the level of bowing, or is closer to bowing – according to the difference among scholars – their Salah is invalidated.
And it is appropriate not to bend in sitting to the extent that the forehead goes beyond the knees.
And Allah knows best.