The definition he gave when asked who counts
It is given from the other person's side.
الْمُسْلِمُ مَنْ سَلِمَ الْمُسْلِمُونَ مِنْ لِسَانِهِ وَيَدِهِ، وَالْمُهَاجِرُ مَنْ هَجَرَ مَا نَهَى اللَّهُ عَنْهُ
Al-muslimu man salima-l-muslimūna min lisānihi wa yadih, wa-l-muhājiru man hajara mā nahā-Llāhu ʿanh
The Muslim is the one from whose tongue and hand other Muslims are safe. And the emigrant is the one who leaves what Allah has forbidden.
Where this comes from
Both halves redefine a word by what a person does rather than what they are called. Neither definition can be checked from the inside.
The full narration
Narrated 'Abdullah bin 'Amr: The Prophet (ﷺ) said, "A Muslim is the one who avoids harming Muslims with his tongue and hands. And a Muhajir (emigrant) is the one who gives up (abandons) all what Allah has forbidden
Source
Ṣaḥīḥ al-Bukhārī · 10
- Agreed upon as authentic (al-Bukhārī / Muslim)