All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
First of all, you should repent to Allah, the Almighty, and ask for His forgiveness from the sin that you committed; violating the sanctity of this great month and invalidating your fasting. A compensatory fast is due on you for the day on which you discharged semen without penetration, because your fasting was invalidated by the intentional discharge of semen. However, according to the majority of the scholars, no expiation is due on you because of the discharge of semen only as long as it was not caused by sexual intercourse.
Nevertheless, the Maliki scholars are of the opinion that major expiation (of fasting two months consecutively) is due for the intentional discharge of semen by kissing or physical contact or foreplay, even if one usually does not discharge semen whenever he does any of such things nor persists in doing any of those till he emits semen.
We opt for the opinion that no expiation is due, as according to the majority of the scholars. We advise you, dear Brother, to fear Allah, the Almighty; observe His commandments; and avoid such things which are impermissible during fasting.
Allah knows best.