It was narrated from Usamah bin Zaid, who attributed it to the Prophet (ﷺ):
“The Muslim does not inherit from a disbeliever and the disbeliever does not inherit from a Muslim.”
اسامہ بن زید رضی اللہ عنہما کہتے ہیں کہ
نبی اکرم صلی اللہ علیہ وسلم نے فرمایا: مسلمان کافر کا وارث نہیں ہو گا، اور نہ کافر مسلمان کا وارث ہو گا ۔