Religion and the legal system In the Ottoman Empire 
The main idea behind the Ottoman legal system was the “confessional community“. The Ottomans tried to leave the choice of religion to the individual rather than imposing forced classifications. However, there were grey areas.
Ottoman practice assumed that law would be applied based on the religious beliefs of its citizens. However, the Ottoman Empire was organized around a system of local jurisprudence. Legal administration fit into a larger schema balancing central and local authority. The jurisdictional complexity of the Ottoman Empire aimed to facilitate the integration of culturally and religiously different groups.
There were three court systems: one for Muslims, another for non-Muslims (dhimmis), involving appointed Jews and Christians ruling over their respective religious communities, and the “trade court”. Dhimmis were allowed to operate their own courts following their own legal systems in cases that did not involve other religious groups, capital offences, or threats to public order.
Millet (Ottoman Empire)
In the Ottoman Empire, a millet was a separate legal court pertaining to “personal law” under which a confessional community (a group abiding by the laws of Muslim Sharia, Christian Canon law, or Jewish Halakha) was allowed to rule itself under its own laws. Despite frequently being referred to as a “system”, before the nineteenth century the organization of what are now retrospectively called millets in the Ottoman Empire was far from systematic. Rather, non-Muslims were simply given a significant degree of autonomy within their own community, without an overarching structure for the ‘millet’ as a whole.
Sources: The Millet in the Ottoman Empire