If your husband's oath that you would be divorced if you spoke to your sister's husband -- such as if he said: You are divorced if you speak to him; or if he made divorce conditional upon that and said: If you speak to your sister's husband then you are divorced -- if he wanted to stop you speaking to him for a clear reason, such as if the man was not proper in the way he spoke to you, or if he talks too much in a way that annoys your husband, or he is afraid of some evil resulting from his speaking to you, then in that case there is nothing wrong with him preventing you, even if he (your husband) speaks to your sister.
It is well-known that you are a stranger or non-mahram to your sister's husband, so it is not permissible for you to uncover anything in front of him, nor is it permissible for you to shake hands with him, and you must control your speaking with him so that there is no softening of the voice or speaking too much unnecessarily, because you are a non-mahram like any other.
This conditional divorce is subject to further discussion:
If the husband intended that divorce should take place if you spoke to your sister's husband, then if you spoke to him, divorce has taken place.
If he intended only to stop you doing it, and he did not intend that divorce should take place, then this is an oath (and not a divorce). If he wants to, he may let you off and offer expiation for his oath.
This differentiation is the view favoured by Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him), and it was also stated in the fatwas of a number of scholars. The majority of scholars, however, are of the view that there is no such differentiation, and that if this talking takes place, then divorce has occurred, regardless of the intention of the one who uttered the conditional divorce.
Please see the answer to question number 39941.
If you spoke to him on the basis that you had forgotten your husband's oath, then divorce does not take place according to the more correct opinion, which is the view of the Shaafa’is and of Ahmad according to one report. It was also the view favoured by Shaykh al-Islam Ibn Taymiyah, and was regarded as correct by al-Mardaawi in al-Insaaf, 9/114.
Shaykh al-Islam Zakariya al-Ansaari said in Asna’l-Mataalib (3/301): Similarly, the divorce does not take place if he made it conditional upon the action of another person, such as a wife or someone else, and he intended thereby to prevent that person from doing something or urge him or her to do something, and that person would care about this conditional divorce and would do something to make it happen, because of friendship or the like, and he or she was aware of this conditional divorce and did what he or she was not supposed to do out of forgetfulness or ignorance or under compulsion.
Ibn Hajar al-Haythami said in al-Fataawa al-Fiqhiyyah al-Kubra (4/178): If a person issues a conditional divorce or swears an oath conditional upon him doing something himself, then he does that thing because he forgot about that condition, or he remembered it but he was forced to do it, or he did it by choice, unaware of the implications of the condition, then he has not broken his oath, because of the report mentioned above: “Allaah has forgiven my ummah for mistakes, what they forget and what they are forced to do” – in other words, He will not punish them for any of these three things. Similarly he has not broken his oath if he made it conditional upon the action of another person who cares about this condition, such that he would not go against it because of friendship, embarrassment or chivalry, and he intended by means of that oath to prevent him from doing something or urge him to do something, and the other person was aware of the condition and he did it the action in question) out of forgetfulness or ignorance or under compulsion.
See: Fataawa al-Shaykh Ibn Baaz (22/47).
The fact that your sister conveyed to you her husband's salaam and you returned his greeting is not regarded as speaking to your sister's husband, so it does not affect you, but you should refer to your husband to find out the limits of what he is allowing and not allowing, and what he intended by his conditional divorce, because the intention specifies the wording. So it may be that he intended to prevent you from speaking to him at one time but not another, or in one situation but not another, or he wanted to prevent too much talk between you, but not brief exchanges such as saying salaam and the like.
What we advise you to do is to take care of your home and family, and avoid talking to your sister's husband altogether, and keep away from situations that lead to that, so long as your husband doesn't want you to do that, in order to please your husband and to avoid divorce taking place. At the same time you should think positively of your husband and look for excuses for him. He may have a genuine reason for doing that. We also advise you to observe hijab in front of your sisters’ husbands and your husband’s brothers, because they are all non-mahrams for you.
We ask Allaah to increase you in guidance and wisdom.
And Allaah knows best.