Abu Burda reported,

I went in to see Abu Musa while he was in the house of the daughter of Fadl bin Abbas. I sneezed, and he did not invoke a blessing on me, then she sneezed, and he invoked a blessing on her. So I returned to my mother and told her what had happened.When he came to her, she said, "My son sneezed in your presence and you did not invoke a blessing on him, then she sneezed and you invoked a blessing on her."He replied, "Your son sneezed but did not praise Allah, so I did not invoke a blessing on him. She sneezed and praised Allah, so I invoked a blessing on her. I heard the Messenger of Allah ﷺ say, 'When one of you sneezes and praises Allah, invoke a blessing on him, but if he does not praise Allah, do not invoke a blessing on him.'"

Azami 11294

Sahih

عن أبي بردة، قال

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

الأعظمي 11294صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Supplications for various occasions
Section
Not saying "yarhamuk Allah" to one who does not praise Allah after sneezing
Numbering
Jami al-Kamil 11294 (2nd edition)
Azami 11294