Abu Hurairah (May Allah be pleased with him)reported in the Hadith in respect of the person who was at fault in performing his Salat (prayer):
He came to the Prophet (ﷺ) and greeted him. The Prophet (ﷺ) responded to the greeting and said, "Go back and repeat your Salat because you have not performed the Salat (properly).'' He again performed Salat as he had prayed before and came to the Prophet (ﷺ) and greeted him. The Prophet (ﷺ) responded to the greetings (and repeated his words to him). This act of repeating (the Salat and the Salam) was done thrice.[Al-Bukhari and Muslim].
App reference: Book 6, Hadith 15
Arabic/English book reference: Book 6, Hadith 859