Praise be to Allah.
The scholars differed as to whether a talaaq given as a joke counts as such. The majority are of the view that it does count as such, as has been stated previously in the answer to question no. 44038. But whether the husband repeats the “talaaq” twice or three times or more, it only counts as one according to the more correct opinion, because the second talaaq can only be given after doing a new marriage contract or taking the wife back.
Based on that, what happened to you the first time was one talaaq.
Khula‘ is not regarded as a divorce (talaaq), even if the word talaaq is used, according to the more correct opinion. See the answer to question no. 126444.
Based on that, only one talaaq has taken place, and if you want to go back to your husband, it is permissible to do so with a new marriage contract, because khula‘ invalidates the first nikaah.
And Allah knows best.