If a person makes his opening takbir behind a row and then he enters the row and performs the ruku’ with the imam, his salah will be valid.
Abu Bakra reports that he came to the salah while the Prophet was performing ruku’ and Abu Bakra performed the ruku before he entered the row. He mentioned this to the Prophet and he said: “May Allah increase your love for goodness, but do not repeat that act.” This is related by Ahmad, al-Bukhari, Abu Dawud, and anNasa’i.
According to the majority, If a person prays behind the rows by himself, his salah will be valid but disliked. Ahmad, Ishaq, Ahmad, ibn Abu Laila, Waki’, al-Hassan ibn Saleh, an-Nakha’i and Ibn al-Munzhir hold that if a person prays one complete rak’ah behind the rows, his salah will be invalid.
Wabsah relates that the Messenger of Allah saw a man praying behind the rows by himself and the Prophet ordered him to repeat his salah. This is related by the five save an-Nasa’i. In Ahmad’s version, the Messenger of Allah was asked about a man who prays by himself behind the rows and he said: “He is to repeat his salah.” At-Tirmizhi called this hadith hasan and Ahmad’s chain is good.
‘Ali ibn Shaiban relates that the Messenger of Allah saw a man praying behind the row and he waited for him and (when he finished) told him: “Go forward (and join the row) for the salah of a person standing alone behind the rows is not valid.” This is related by Ahmad, Ibn Majah, and al-Baihaqi. Ahmad says it is hasan. Ibn Sayyid an-Nass said its narrators are well-known, trustworthy people.
The majority stick to the hadith of Abu Bakra who said that he preformed part of the prayer, behind the row, and the Prophet did not order him to repeat his salah. Repeating the salah signifies over in practicing what is recommended and better.
Al-Kaman ibn al-Hamam said: “Our scholars are of the opinion that the hadith of Wabsah refers to what is preferred while the hadith of ‘Ali ibn ash-Shaiban underlines failure to practice what is the best and, as such, they are in harmony with the hadith of Abu Bakra. It is clear, then, that it is not necessary to repeat the salah because such an act was not always ordered.
If someone comes to the row and does not find sufficient space or a gap to stand in the row, then, according to some, he should stand by himself and it is disliked that he should pull anyone back from the row. Others say that he should pull one, who is aware of the ruling, back from the row after they have performed the opening takbir, and it is preferred for the one who is pulled to join him.”