Sunan an-Nasa'i, Book 47, Hadith 43 (In-Book) ⓘ
Abu Hurairah narrated that: The Messenger of Allah [SAW] said: "Whoever stands (in the voluntary night prayer of) Ramadan out of faith and in the hope of reward, his previous sins will be forgiven. And whoever spends the night of Lailat Al-Qadr in prayer out of faith and in the hope of reward, his previous sins will be forgiven."
حَدَّثَنَا أَبُو الْأَشْعَثِ قَالَ حَدَّثَنَا خَالِدٌ يَعْنِي ابْنَ الْحَارِثِ قَالَ حَدَّثَنَا هِشَامٌ عَنْ يَحْيَى بْنِ أَبِي كَثِيرٍ عَنْ أَبِي سَلَمَةَ بْنِ عَبْدِ الرَّحْمَنِ قَالَ حَدَّثَنِي أَبُو هُرَيْرَةَ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ مَنْ قَامَ رَمَضَانَ إِيمَانًا وَاحْتِسَابًا غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ وَمَنْ قَامَ لَيْلَةَ الْقَدْرِ إِيمَانًا وَاحْتِسَابًا غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ
also referenced under: Hadith 5027 (Reference) & Volume 6, Book 47, Hadith 5030 (DarusSalam)