Assalamu Alaikum. I am having severe waswas of divorce for almost 3 months. I try to hold my tongue under my teeth to prevent it from speaking these words but at times I have no control over myself, especially during sleeping. These things come into my mind and when I wake up in the morning, the first thing that comes into my mind is this. I have no intention of divorcing my wife at all. What is the ruling of a person who is not in control of himself when he has no intention of divorcing his wife but can control his mind or tongue?
بسم الله الرحمن الرحيم
In The Name Of Allah, The Most Gracious, The Most Merciful
It is not clear from your question whether you have OCD and have been diagnosed with it, or if you are only suffering from waswas.
It is important that if you are having these compulsive behaviours in other areas that you seek advice and help from professionals. In any circumstance, if you have been diagnosed with OCD and hence deemed as not possessing a sound mind then any divorce you uttered would not be considered.
In regards to your question, firstly be advised that any dreams or waswas which comes to you while you are sleeping has no effect. This is because the Prophet (pbuh) said:
“The pen is lifted from three people: a sleeping person until he awakens, a child until he becomes an adult, and an insane person until he regains his sanity.” (Sunan at-Tirmidhi, Hadith 1423)
Secondly, in the situation where you have not been diagnosed, but have waswas to say divorce, so long as you don’t pronounce the actual words of
divorce, then divorce does not take place, because the specific statement is required for a divorce to occur. 
Because you are suffering from waswas, you should take extra care to recite Quran daily and make ruqya upon yourself. Ensure that you take extra care in your ibadah and abiding by Allah (swt)’s commands and prohibitions while seeking help from Him (swt).
Only Allah knows best
Written by Alimah Nasima Umm Hamza
Checked and approved by Mufti Mohammed Tosir Miah
Darul Ifta Birmingham
 Al-Kasaani, Bada’i as-Sanaa’i, Kitaab at-Talaq, Volume 3, Page 99
 Ibn Abideen, Raddul Muhtaar, Volume 3, Page 230