عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ رَضِيَ اللَّهُ عَنْهُ قَالَ: صَلَّى رَجُلٌ خَلْفَ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ فَجَعَلَ يَرْكَعُ قَبْلَ أَنْ يَرْكَعَ، وَيَرْفَعُ قَبْلَ أَنْ يَرْفَعَ، فَلَمَّا قَضَى النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ الصَّلَاةَ قَالَ: ((مَنْ فَعَلَ هَٰذَا؟)) قَالَ: أَنَا يَا رَسُولَ اللَّهِ! أَحْبَبْتُ أَنْ أَعْلَمَ تَعْلَمُ ذَلِكَ أَمْ لَا، فَقَالَ: ((اتَّقُوا خِدَاجَ الصَّلَاةِ إِذَا رَكَعَ الْإِمَامُ فَارْكَعُوا وَإِذَا رَفَعَ فَارْفَعُوا))
Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) narrates that a man prayed behind the Noble Prophet (peace and blessings be upon him), and he used to bow (ruku') before the Prophet (peace and blessings be upon him) and would rise before him as well. When the Prophet (peace and blessings be upon him) completed the prayer, he said: Who was the one doing this? He said: O Messenger of Allah! It was me, I wanted to know whether you would notice or not. The Noble Prophet (peace and blessings be upon him) said: Protect your prayer from harm; when the Imam bows, then you should bow, and when he raises his head, then you should raise your head.