[Machine] Oaths are of two types: expiable and non-expiatory. If a person says, "By Allah, I did not do it" or "By Allah, I definitely did it not," there is no expiation for him in either case. If he intentionally swore falsehood, it is a lie, and if he believed that what he said was true, it is frivolous. If a person says, "By Allah, I will not do it" or "By Allah, I will definitely do it," then there is expiation in these cases. The scholar Al-Layth and Hammad bin Abi Sulaiman have relied on these two types of oaths for evidence, but Allah knows best. It has also been narrated from another perspective from Ibn Mas'ud.
الْأَيْمَانُ أَرْبَعٌ يَمِينَانِ يُكَفَّرَانِ وَيَمِينَانِ لَا يُكَفَّرَانِ قَوْلُ الرَّجُلِ وَاللهِ مَا فَعَلْتُ وَاللهِ لَقَدْ فَعَلْتُ لَيْسَ فِي شَيْءٍ مِنْهُ كَفَّارَةٌ إِنْ كَانَ تَعَمَّدَ شَيْئًا فَهُوَ كَذِبٌ وَإِنْ كَانَ يَرَى أَنَّهُ كَمَا قَالَ فَهُوَ لَغْوٌ وَقَوْلُ الرَّجُلِ وَاللهِ لَا أَفْعَلُ وَوَاللهِ لَأَفْعَلَنَّ فَهَذَا فِيهِ كَفَّارَةٌ قَالَ الشَّيْخُ وَلَيْثٌ وَحَمَّادُ بْنُ أَبِي سُلَيْمَانَ غَيْرُ مُحْتَجٍّ بِهِمَا وَاللهُ أَعْلَمُ وَرُوِيَ مِنْ وَجْهٍ آخَرَ عَنِ ابْنِ مَسْعُودٍ