He made her divorce conditional upon her disobeying him, and she disobeyed him concerning something that came before his making it conditional; does the divorce count as such?
Firstly: it is not appropriate for the husband to hasten to make divorce conditional upon something that the wife does. If he does that, then she is divorced. In many cases the husband regrets it after that, but at a time when this regret does not benefit him.
You made a mistake when you made your wife's divorce conditional on her not obeying you. That is not part of treating her kindly. It is something that is very harsh on the wife, because you may tell her to do something that harms her or something that is not pleasing to her or something that is very difficult for her, then the wife will be caught between a rock and a hard place: either she obeys you reluctantly, and that will undoubtedly have a negative effect on the relationship between you, or she will not obey you and then divorce will happen.
If a person makes divorce of his wife conditional upon something, if his aim in doing so was merely to frighten her and threaten her, then it comes under the ruling on oaths, and he has to offer expiation for breaking an oath (kafaarat yameen) if she does that on which her divorce was made conditional, but it does not count as a divorce. If his aim was indeed that divorce should happen, then it does count as a divorce if she does the thing on which divorce was made conditional.
See the answer to question number 82400.
With regard to whether divorce has taken place because she disobeyed you with regard to something that came up before these words were spoken, it depends on your intention. If when you said that, you meant all your commands to her, past and future, then divorce has taken place; but if you meant whatever commands came after stipulating this condition of divorce, then divorce has not taken place.
And Allaah knows best.