It is a grave error for a man to hasten to utter the word of divorce, because that may lead to the breakdown of his family when he does not intend it to. Allaah has not prescribed divorce to be a means of venting anger, rather He had prescribed it to be used by a man at times when he wants to end a marriage where there is a reason for doing so.
Based on that, you should guard your tongue and resist uttering the word of divorce at times of anger and of contentment.
When a man utters divorce in anger, one of three scenarios must apply:
1 – His anger is mild in the sense that it does not affect his will and choice. In this case his divorce is valid and counts as such.
2 – His anger is so intense that he does not know what he is saying and is unaware of it. This divorce does not count as such because he is like the insane man who is not held accountable for what he says.
Concerning these two scenarios there is no difference of opinion among the scholars. There remains the third scenario which is:
3 – Intense anger which affects a man’s will and makes him say words as if he is compelled to do so, but he regrets it as soon as his anger dissipates, and it does not reach a level where he does not realize what he is doing and has no control over his words or actions. The scholars differed concerning the ruling on this type of anger. The most correct view – as Shaykh Ibn Baaz (may Allaah have mercy on him) said – is that it does not count as a divorce either, because the Prophet (peace and blessings of Allaah be upon him) said: “There is no divorce and no manumission at the time of coercion.” Narrated by Ibn Majaah (2-46); classed as saheeh by al-Albaani in al-Irwa’ (2047). The scholars interpreted coercion as meaning compulsion and intense anger.
This view was favoured by Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) and his student Ibn al-Qayyim, who wrote a famous essay on the topic entitled Ighaathat al-Lahfaan fi Hukm Talaaq al-Ghadbaan.
See also the answer to question no. 45174.
Based on this, if your anger reached this level and this is what made you utter the words of divorce, and were it not for this anger you would not have divorced her, then the divorce does not count as such in that case.
If a man says to his wife: ‘You are divorced, you are divorced, you are divorced” or “You are thrice divorced”, this counts as a single divorce (talaaq). This is the view favoured by Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) and his student Ibn al-Qayyim. Among contemporary scholars it was regarded as most correct by Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him). See al-Sharh al-Mumti’ (13/42).
And Allaah knows best.