The Messenger of Allah (sal Allahu alaihi wa sallam) said: “When you wish to offer prayer, perform Wudhu properly and turn towards the Qibla. Recite the initial Takbeer (Allahu Akbar) and then recite from the Quran as much as it is easy for you. Later bow for Ruku and stay there stock-still for a while. Then straighten back up until your head is upright. When you descend for Sajda, stay still for a while there; then lift your head and sit until you are completely stationary. If you do these actions from top to bottom during your prayer, your prayer is a whole; and whatever you reduce from these actions, you lessen the same from your prayer as well.” [Abu Lays Samarqandi, Tanbihul Ghafileen]
Khallad (radi Allahu anhu) came to the Masjid of the Prophet (sal Allahu alaihi wa sallam) and offered his prayer while the Prophet (sal Allahu alaihi wa sallam) was sitting. After he was done he came to greet the Prophet (sal Allahu alaihi wa sallam). The Prophet (sal Allahu alaihi wa sallam) instructed him to pray again.
When this happened three times, as Khallad (radi Allahu anhu) was not bowing and prostrating properly, he vowed that he didn’t know any better and requested the Prophet (sal Allahu alaihi wa sallam) to teach him the correct way of offering prayer so that his prayers would count.
On this request the Prophet (sal Allahu alaihi wa sallam) taught Khallad (radi Allahu anhu) how to properly perform the prayer, as mentioned in the Hadith above.