She has been divorced a second time and her ‘iddah has ended
Question

                We got married 17 years ago. My wife became depressed for some time and asked for divorce many times during this depression stage. I tried many times to treat her. Once she was about to commit suicide by taking a large dose of tablets. I said to her that time that she is divorced. But then I returned her to me after 17 days. The next day she again asked for divorce but I did not divorce her. Then she traveled to Egypt for her doctorate exam. She tried to get my mobile number from my family and sent me a text message on my mobile saying that she will kill herself if I do not send her the paper of divorce. So I sent her a text message lying, knowing that I did not have the intention to divorce her; I just feared she kills herself as she said. When she returned to Saudi I felt that she really insists on divorce, so I said to her: “you are divorced” three times. But I know very well that it is my second time to divorce her, as I also know that saying the word of divorce three times at the same time is considered only one divorce, as known to me and all.      

Now, after 85 days from this incident, by Allah’s grace, and some friends interceding, I want her back to me. She told me that she had three menstruating periods already. We work in the same place and she is a professional colleague of mine. I want to protect my home; especially that we have teenage children.
Praise be to Allah.Firstly: 
Divorce in writing does not 
    count as such unless the husband intends it as such. If he writes a divorce 
    to his wife but he did not intend to divorce her, then divorce does not take 
    place according to the majority of scholars, and this was the view favoured 
    by Shaykh Muhammad ibn Ibraaheem and Shaykh ‘Abd al-‘Azeez ibn Baaz (may 
    Allaah have mercy on them). 
This has been explained in 
    the answer to question no. 72291. 
    Based on this, the text message that you sent via mobile phone does not 
    count as a divorce because you did not intend it as such. 
Secondly: 
If a man says to his wife, 
    “You are divorced, you are divorced, you are divorced,” intending thereby 
    one talaaq and only repeating the phrase for emphasis or to make sure his 
    wife understands the words, this only counts as one talaaq, according to the 
    four imams (may Allaah have mercy on them). 
See: al-Mawsoo’ah 
    al-Fiqhiyyah (1/221). 
Based on this, when you 
    said to your wife “You are divorced, you are divorced, you are divorced,” 
    intending thereby only one talaaq, it counted as one talaaq, and this was 
    the second talaaq. 
As her ‘iddah has ended, 
    you cannot take her back, but there is nothing wrong with doing a new 
    marriage contract with her, subject to the usual conditions of marriage: the 
    woman’s consent, and the presence of two witnesses and her wali (guardian), 
    etc. 
She can come back to you on 
    the basis of this marriage contract, with the outstanding number of 
    divorces, i.e., there is only one talaaq left with her. 
You should help your wife 
    to get rid of this depression by finding out its causes and dealing with 
    them, and by pursuing the means that will help to bring her relief and peace 
    of mind. 
And Allaah knows best.