Question: A man swore by the divorce of his wife if she entered the house of so-and-so, and his motive for swearing was that in that house there was a man about whom he had doubts. If that man then leaves that house, does his wife become divorced if she enters it?
Answer – and Allah is the One who grants success: The swearer’s intention is what counts for him. So if the intention of the one who swore by divorce if she entered that house was that (divorce would occur) with the presence of that man in the house, and his intention was directed specifically toward him, then the wife does not become divorced if she enters the house after that man has left it.
The scholars of the madhhab have said: If a man swears that his guests will not leave, he fulfills (his oath) if they eat the customary food. End quote.
This is only because the swearer has his own intention and purpose, and the oath is directed toward intention and purpose rather than the outward wording. So even if an oath, in its outward form, appears unrestricted and general, it is restricted by intention and purpose. This is as between him and Allah, Exalted is He, not in the outward judicial ruling.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2