Mujahid said:“Apponting a way in the verse (iv.15) means prescribed punishment.Sufiyan said: “Punish them “refers to unmarried, and “confine them to houses” refers to the women who are married.
حَدَّثَنَا أَحْمَدُ بْنُ مُحَمَّدِ بْنِ ثَابِتٍ، حَدَّثَنَا مُوسَى، - يَعْنِي ابْنَ مَسْعُودٍ - عَنْ شِبْلٍ، عَنِ ابْنِ أَبِي نَجِيحٍ، عَنْ مُجَاهِدٍ، قَالَ السَّبِيلُ الْحَدُّ قَالَ سُفْيَانُ { فَآذُوهُمَا } الْبِكْرَانِ { فَأَمْسِكُوهُنَّ فِي الْبُيُوتِ } الثَّيِّبَاتِ .
AbuDaud
Prescribed Punishments (Kitab Al-Hudud) • Hadith 4414