The defendant has to take an oath wherever it becomes legally compulsory Sahih al-Bukhari 2673
Arabic hadith text
حَدَّثَنَا مُوسَى بْنُ إِسْمَاعِيلَ، حَدَّثَنَا عَبْدُ الْوَاحِدِ، عَنِ الأَعْمَشِ، عَنْ أَبِي وَائِلٍ، عَنِ ابْنِ مَسْعُودٍ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ "مَنْ حَلَفَ عَلَى يَمِينٍ لِيَقْتَطِعَ بِهَا مَالاً لَقِيَ اللَّهَ وَهْوَ عَلَيْهِ غَضْبَانُ "
Translation
Narrated Ibn Mas`ud
The Prophet (ﷺ) said, "Whoever takes a (false) oath in order to grab (others) property, then Allah will be angry with him when he will meet Him."