All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
The majority of Muslim scholars are of the opinion that the divorce does not take place by the fact that a person who is able to speak writes the Talaaq (divorce) unless he actually intended to divorce his wife when writing the divorce wording.
Therefore, you have to ask your husband when he comes back whether he intended divorce while writing divorce or not? If he admits that he had intended divorce then the first divorce occurred. He may take you back if you are still in your waiting period. If the waiting period has expired then a new marriage contract fulfilling all the conditions should be established.
If he did not intend the divorce while writing the divorce then the divorce did not occur.
Allaah Knows best.