Asalamu alaykum
there is a differnce in opinion on this matter some say if u can pratice ur deen you may stay if u cant you must leave but hijrah for the sake of Allah is great thing
the other opinion is that it is obligated for a person to do so
Here are 2 fatwas to show the daleel inshallah it will help
When does Hijrah (a believer’s migration to an Islamic land) become necessary?
Fatwa no. (1177):
Q: What is the ruling on a person who worships Allah Alone and associates nothing with Him in worship, yet he is living with communities of disbelievers and is unable to openly declare his Islam, or clarify its objectives, or leave the non-Muslim country where he lives?
A: If the situation is as you have mentioned, then this person is excused for being incapable of leaving the non-Muslim land and fleeing with his religion to a place where he can publicly profess Islam, propagate it and clarify its objectives to others. May Allah pardon his incapacity. However, he should exploit the opportunity of living in a non-Muslim land in calling non-Muslims to embrace Islam secretly. It may be that Allah arranges for him those who will both respond to his call and be a means of support to him. He should also try his best to migrate from this non-Muslim land to a Muslim land whenever the opportunity presents itself. This helps in increasing the number of Muslims and he will be able to share practicing the rites of Islam with them.
On the other hand, Muslims who are able to migrate to Muslim countries, yet prefer to live suppressed or servile in non-believers’ countries at the compromise of their religion are doing wrong to themselves, to their religion and to Muslims on the whole. They are threatened to end up abiding in Hellfire.
( Part No : 2, Page No: 69)
What an evil destination! Allah (may He be Exalted) says (what means):Surah Al-Nisa', 4: 97 Verily, as for those whom the angels take (in death) while they are wronging themselves (as they stayed among the disbelievers even though emigration was obligatory for them), they (angels) say (to them): “In what (condition) were you?” They reply: “We were weak and oppressed on the earth.” They (angels) say: “Was not the earth of Allâh spacious enough for you to emigrate therein?” Such men will find their abode in Hell - What an evil destination! Surah Al-Nisa', 4: 98 Except the weak ones among men, women and children who cannot devise a plan, nor are they able to direct their way. Surah Al-Nisa', 4: 99 These are they whom Allâh is likely to forgive them, and Allâh is Ever Oft-Pardoning, Oft-Forgiving.
May Allah grant us success! May peace and blessings be upon our Prophet Muhammad, his family and Companions!
Permanent Committee for Scholarly Research and Ifta’
Hijrah (a believer's migration to an Islamic land)
( Part No : 12, Page No: 48)
The sixth question of Fatwa No. ( 7150 )
Q 6: what are the conditions of Hijrah according to Islam? what is meant by the following statement of the Prophet (peace be upon him): Worship (of Allah) during the period of widespread turmoil is like emigration towards me. ?
A: Hijrah means leaving the non-Muslim country to a Muslim country, which is obligatory. Allah (may He be Exalted) stated:Surah Al-Nisa', 4: 97 Verily, as for those whom the angels take (in death) while they are wronging themselves (as they stayed among the disbelievers even though emigration was obligatory for them), they (angels) say (to them): “In what (condition) were you?” ... till His statement:Surah Al-Nisa', 4: 97 Such men will find their abode in Hell - What an evil destination! Commenting on the Ayah (Qur'anic verse), Ibn Kathir said, "This glorious Ayah's general meaning includes all those who reside among non-Muslims while able to emigrate and cannot establish the rites of the religion. Such persons, by remaining are wronging themselves and committing an unlawful act according to scholars' unanimous agreement." End quote.
As for the Hadith stating: Worshiping during the period of widespread turmoil is like emigration towards me, it indicates the superiority of worshipping Allah during times of turmoil and fighting, which is equal in reward to emigration to the Prophet (peace be upon him) undertaken by Muslims of his time to Madinah from the non-Muslim country, i.e. Makkah before the Conquest of Makkah. The Hadith does not mean that Hijrah does not apply to those residing in non-Muslim countries and cannot
( Part No : 12, Page No: 49)
establish the rites of religion among non-Muslims.
May Allah grant us success! May peace and blessings be upon our Prophet Muhammad, his family and Companions!
Permanent Committee for Scholarly Research and Ifta
And if you really want to better understand pls go
here