Apostasy is a term in military (religious) jurisprudence that means leaving your religion and disbelief in Islam. An apostate is someone who is already Muslim and then disbelievers. (In Islam) apostates are divided into two categories: “Natural” and “National”, each of which has its own rulings.
1- Literary meaning
Apostasy literally means to “leaving” and “Departing” (abandon or renunciation of a religious belief).
Definition of apostasy by Mariam-Webster: “1: An act of refusing to continue to follow, obey, or recognize a religious faith. 2: Abandonment of previous loyalty. (All in parentheses and definitions are added by translator)
2- The meaning of the term
The term of apostacy in Islamic jurists is defined as turning away from the religion and becoming an infidel. Infidelity in Islam is a person who was Muslim and then became an infidel by leaving Islam, which defines an apostate.
3- Apostasy in the Quran
Its root in the Qur’an is as follows:
«وَ مَنْ یَرْتَدِدْ مِنْکُمْ عَنْ دینِهِ فَیَمُتْ وَ هُوَ کافِرٌ فَاولئِکَ حَبِطَتْ اعْمالُهُمْ فِی الدُّنْیا وَالْاخِرَةِ وَاولئِکَ اصْحابُ النَّارِ هُمْ فیها خالِدُونَ؛
“Whoever of you turns away from his religion (Islam) and apostatizes, then s/he dies while they become an infidel; “The deeds of such people are corrupt and void in this world and in the Hereafter, and they will be caught in the Fire and will abide in Hell forever.” 
Whoever among you turns back from his religion and dies a disbeliever—those are they whose works will come to nothing in this life, and in the Hereafter. Those are the inmates of the Fire, abiding in it forever.)
whoever among you renounces their own faith and dies a disbeliever, their deeds will become void in this life and in the Hereafter. It is they who will be the residents of the Fire. They will be there forever.”(Other Islamic translations)
4- Types of apostates
There are two types of apostates: “Natural” and “National”.
4.1 – Natural apostate
A “Natural apostate” is a person who, at the time of fertilization, one of his/her mother or father, or both, were Muslim (and) but has converted to Islam after reaching adulthood and then has left the religion of Islam.
4.2 – National apostate
A national apostate is a person whose parents were infidels during the coagulation of sperm (conception) and who, after reaching adulthood, declared infidelity (believes in his/her parents’ religion), then converted to Islam, and then returned to infidelity again.
5- How to realize disbelief
How is disbelief achieved? Infidelity is realized in several ways: by “intention”, by “word” and by “deeds”.
5.1 – Infidelity with intent
Infidelity with the intention is to decide on infidelity in the future, even doubting the origin of the world of creation or the mission of the Messenger of God “Mohammad” (peace and blessings of God be upon him) is disbelieving.
5.2 – Linguistic infidelity
Blasphemy is a language that denies God with words, or denies the mission of the divine prophets, or considers halal haram, or considers haram halal, or denies one of the duties of Islam, such as prayer, fasting, and so on. In short, the general criterion is the denial of one of the necessities of religion if this denial goes back to the denial of the mission (prophecy). It goes without saying that it does not matter whether it is due to stubbornness or belief or ridicule.
5.3 – Practical disbelief
Practical blasphemy refers to an explicit and insulting act that violates the holy Shari’a, which implies a violator of Islamic Shari’a, such as violating the Qur’an, the names of God, the name of the Prophet (peace and blessings of Allaah be upon him), the names of the infallible “Shiite’s Imams and their relatives” (peace be upon them), their holy books and Islamic books. . or setting them on fire  (For more information, you can refer to the article of the infidel. )
6- A narration from Imam Sadegh
Ibn Sinan has narrated from Imam Sadiq (as) as follows:
“Whoever doubts in the sight of God Almighty and in His Messenger, Mohammad (may God bless him and grant him peace), is a disbeliever; 
7- Conditions of apostasy
Apostasy, whether “Natural” or “National”, must meet the following conditions:
4- Intention  
8- The sentence of a “Natural Apostate”:
Inherently converting to Islam by an apostate is not accepted. If the apostate is a man, he will be killed. 
The Prophet (peace and blessings of Allah be upon him) said: “Whoever turned Islam into infidelity, kill him.”  And his wife should divorce him, and her marriage would be dissolved without divorce. She does not need to wait for “Death kit” (عدّه وفات*) to get re-marry, so if she wishes, she could marry (right away), and the property of the apostate, which belonged to him at the time of his apostasy, should be divided among his heirs after the payment of his debts, Like a corpse. 
And if the “Natural apostate” is a woman, she will not be killed. Rather, she is imprisoned forever and at the time of prays (five times a day) should be lashed, and she should be deprived of her livelihood. If her repentance is accepted, so if (only) she repents, she would be released from prison. 
* Death Kit ( عدة الموت): Is the waiting period for a women to re-marry, whose husband died, which is four months and ten days, except if she is pregnant.
9- The verdict of a “National Apostate”
The national apostate man should be advised to repent, so if he refuses, he will be killed, and the precaution is to ask him for three days to repent (and if he does not repent) he will be killed on the fourth day. 
10 – Footnote
1) Baqarah / Sura 2, verse 217.
2) Mohammadi Gilani, Mohammad, Criminal Law in Islam, p. 256, with intrusion Changes
3) See: Wiki Fiqh, article “Infidel” : صفحه اصلی – ویکی فقه (wikifeqh.ir)
4) Horre Ameli, Mohammad ben Hassan, Vasayelo shie’ P.568 Volume 18.
5) Khomeini, Ruhollah, Tahrir al-Wasila, vol. 2, p. 529
6) Mohaqeq Hali, Ja’far ibn Hassan, Sharia al-Islam, vol. 3, p. 617.
7) Khomeini, Ruhollah, Tahrir al-Wasila, Imam Khomeini, vol. 2, p. 528
8) Mohammadi Rey Shahri, Mohammad, Mizan al-Hikma, vol. 2, p. 1062.
9) Khomeini, Ruhollah, Tahrir al-Wasila, vol. 2, p. 395, Al-Mawarith, issue 10.
10. Khomeini, Ruhollah, Tahrir al-Waseela, vol. 2, pp. 528-529, issue 1.
11) Source: A group of authors, Research Institute of Islamic Research, Military Terms in Islamic Jurisprudence, p.13.
Translated by: Ali Abani
Due to “mixed languages of Persian and Arabic” used by Khomeini, the “Non- Academic structures of the sentences” and “strange verbiage” use, I had a hard time to translate it to an easy way of meaning for foreign language speaking people and tried to make sense out of it. Such “Non-Academic sentences” were the use of “AND”. There were many sentences that were connected to each other with an “AND” making a paragraph. I separated them and made a sentence.
It is also needed to mention that some of the word’s usage were from my knowledge and familiarity with Islamic religious writers. One such word was the use of “Probable”, “Precautionary” or “Caution”. They were referred to other “Ayatollah’s” opinions.
Some words in the below Issues did not made sense, one such is “قود” (Ghode). It means “drive” or fuel”. It was used in issue 8.
We tried to stick with the contexts of Khomeini’s statements and for our honesty of the translating we included the original version too.
There is another statement on the below site:
In the book of Inheritance, both types of apostates and some of the rules are discussed, therefore the return back to Islam by “Natural apostate of Islam” )Fetri, A person whose parents both are Muslims and leave Islam after puberty(, would not be accepted, and if male, would be killed. And the apostate woman, even if she is “Natural apostate of Islam”, would not be killed, but would be imprisoned forever, beaten at the time of prayers, deprived of her livelihood, and upon repentance would be accepted, and released from prison. If a male “National apostate of Islam” (Melli, person who was born to a non-Muslim parent but later converted to Islam after reaching the age of puberty but later rejects Islam, is called a national apostate.) was advised to return to Islam but refused, would be killed. In this case, the precaution would be to ask him to repent for three consecutive days. If he did not, he would be killed on the fourth day.
In sentencing of apostasy, “maturity”, “intellect”, “will” and “intention” are valid. Therefore, apostasy of a child, even though he is near puberty, or the madman who is insane, even if it is periodic, or the apostasy of cunning, is not valid. Apostasy without intention, such as joking, forgetfulness, carelessness and unconsciousness are also not valid. If anger prevails while a man is not in control of his anger, he would not be sentenced to apostasy.
If something appears from someone to represent apostasy, then he claims reluctantly, or he claims that he did not intend to be so, if it is probable, it should be accepted of him. And if the evidence is based on the issuance of a word from him that causes apostasy, then what he claims to be mentioned is acceptable to him.
The child of a “National apostate” is considered a Muslim before his apostasy; So, if he matures and disbelieves, he would be guided to repent, so if he repents, that is what he is, otherwise he will be killed. If the child of a “Natural apostate” before his apostasy is a Muslim and he becomes an adult and disbelieves, or if a Muslim child becomes an adult and disbelieves before the declaration of Islam, it seems that the ruling of a “Natural apostate” will not be applied to them, but both will be guided to repent, otherwise they would be killed.
If apostasy from a “National apostate” is repeated, some have said that he will be killed after the third incidence. Some out of religious cautionary have said that if, after being cautioned, he will be killed after the fourth incident.
If a ‘National apostate” becomes insane after apostasy and before repenting, he will not be killed. If, after being guided to repentance, his resistance to it becomes insane, he would be subjected to being killed, just as a “Natural apostate” is killed if he goes insane after apostasy.
If a “National apostate” repents, then someone who believes that he is still an apostate kills him, that person should be punished and requires retribution (punishment inflicted on someone as vengeance for a wrong or criminal act), but strong opinion is it is not retribution but of course, the blood money (compensation paid to the relatives of a murdered person) is on him
If an apostate intentionally kills a Muslim, the murdered’s guardian has the right to kill him as a feul, and this precedes his killing for apostasy. If the guardian pardons or be compensated with money, he still will be killed for apostasy.
Apostasy is proved by the testimony of two just people and by person’s confession. Precautionary obligation is his second stage confession. It. It is not proven by the testimony of women – separately or by attachment.
Source: امام خمینی (س) – ارتداد (imam-khomeini.ir) (page 527)