Shaykh Sulaymaan ibn Naasir al-‘Alwaan was asked:
What is the ruling on a man who has intercourse with his wife when observing an obligatory fast other than in Ramadaan?
He replied: The scholars are unanimously agreed that the expiation is required for having intercourse during the day in Ramadaan, regardless of whether one ejaculates or not.
The only exception they made to that was in the case of one who is forced, one who was ignorant of the ruling, and one who forgot, according to the more correct of the two scholarly views.
If a person ejaculates but does not penetrate then he must make up that day, according to the majority of scholars. If he penetrates but does not ejaculate, then he must offer expiation and make up that day.
The expiation has to do with penetration, not ejaculation.
No expiation is required except for having intercourse during the day in Ramadaan. If a person has intercourse when making up a missed obligatory fast or fasting in fulfillment of a vow, etc., he does not have to offer expiation. This is the view of the majority and is the apparent meaning of the evidence.
More than one of the scholars said that if a man has intercourse on the last day of Ramadaan then he finds out that it is actually Shawwaal, then he does not have to offer expiation, because he found out that it was not obligatory for him to fast (on that day). And Allaah knows best.
See also question no. 40242.