In what occation rasool sallallahu alaihiwasaam said that verily, allah do not see your external form and beauty but allah see on your hearts (ikhlaas)?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
As far as we know, the scholars did not mention any specific occasion for this Hadeeth, but the Prophet said it initially as a warning to his nation to guide it to good. It is not necessary that every Hadeeth has a particular occasion.
Imaam Muslim mentioned this Hadeeth with the wording that is mentioned in the question and in another wording he added the phrase: “and your deeds (actions)” after the word “your hearts”.
In any case, if love for doing good exists in one’s heart, it will be truly demonstrated in his actions.
Allaah Knows best.
You can search for fatwa through many choices