What is the ruling regarding a Muslim man running for the Head of State in the elections in an Islamic country which has unfortunately adopted the system of democracy? If his intentions are to move away from democracy as much as possible and move closer to the Shari’ah, though it would be nearly impossible to significantly change the system, can he run?
You can’t change the system unless people change themselves. So start with Tawheed. Let people first implement sharia in their hearts. Outward implementation and societal implementation would be automatic and natural process. Top down approach would result in rebellion and bloodshed. As far Muslim participating in any of the democratic positions or process, it is kufr.
“Do they then seek the judgement of (the Days of) Ignorance? And who is better in judgement than Allah for a people who have firm faith.” (Quran 5:50).
It is halal for a Muslim to run for the head of state in a country where democratic institutions are practiced. Islam is a way of life but it is not a book of government despite having legal theory and rules. Islam doesn't specify an exact form of government that all Muslims must use, only rules. So how a leader of a nation comes to power and how laws are passed and implemented is a subject of varying different opinions among Muslim Scholars.
Historically and Politically Speaking
Throughout Islamic history, the Rashiduun Caliphate elected their leaders through Shura and consultation. After the Rashiduun's Caliphate's end, most other Islamic empires and nations leaders acted as kings and generally passed on their position to their son or relative.
Democracy is a system of government and most "democratic" governments today are actually constitutional republics with democratic institutions. Pure democracy is mob rule and that is not a popular form of government since tyranny can arise from the majority (Majoritarianism).
A constitution with laws that doesn't oppress Islam and allow Muslims to practice Islam freely (generally dubbed as freedom of religion) is a valid constitution. These governments also, generally speaking, have a system of checks and balances which prevents any one from collecting too much power thus preventing tyranny unlike, unfortunately, many Muslim-majority countries controlled by tyrants who don't rule Islamically in the first place and are often times worse for Muslims than some non-muslim majority countries.
Furthermore, multiple Islamic scholars have expressed opinions that democracy and political participation in it is not haram such as:
Dr. Sheikh Yasir Qadhi: Is Democracy Compatible With Shari'ah? | Shaykh Yasir Qadhi | Faith IQ
Omar Suleiman and Suhaib Webb: Voting and Political Participation: Halal or Haram? - Omar Suleiman and Suhaib Webb
Sheikh Yusuf Al-Qaradawi (Arabic Fatwa): الديمقراطية المنشودة | موقع الشيخ يوسف القرضاوي
So if a Muslim wants to run for the head of state in a country with democratic institutions and intends to do good, then that should not be of any issue.