Abu Hurairah reported,

The Prophet ﷺ would not perform qunut except when he was praying for someone or praying against someone. When he said, "Allah hears the one who praises Him," he would say, "Our Lord, to You belongs all praise. O Allah, save..." and the rest of the hadith was mentioned.

Azami 2852

Sahih

عن أبي هريرة

أن النبي ﷺ كان لا يقنت إلا أن يدعو لأحد، أو يدعو على أحد، وكان إذا قال: سمع الله لمن حمده قال: ربنا ولك الحمد اللهم انج فذكر الحديث.

الأعظمي 2852صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Witr prayer
Section
Prophet ﷺ only performed qunut when supplicating for or against a people
Numbering
Jami al-Kamil 2852 (2nd edition)
Azami 2852