Even if the other dependency tests are met, you are not allowed an exemption for your dependent if he or she files a joint return. (Exemptions are no longer available starting with the 2018 tax year)
Example: You supported your daughter for the entire year while her husband was in the Armed Forces. The couple files a joint return. Even though all the other tests are met, you cannot take an exemption for your daughter.
Exception: The joint return test does not apply if a joint return is filed by the dependent and his or her spouse merely as a claim for refund, and no tax liability would exist for either spouse on separate returns.