When one is in debt, then he does not have to pay Zakat. So if someone owns some money but it is just enough to pay back all his debt if he needs to pay his debt immediately and that will decrease his capital then he does not have to pay Zakat.
الحال الدين يمنع الزكاة، فإذا كان الشخص يملك نصابا وعليه دين يستغرق المال كله، او ينقص النصاب فلا زكاة عليه إذا كان الدين حالا