Answer
Kaffaarah (fasting for two months continuously) has to be given only if you have sexual relations interntionally in one of the private parts.
If you had an ejaculation through kissing, thoughts, touching, etc. then Qadhaa has to be made of that fast only and no Kaffaarah has to be kept. Therefore you should try and recall how many fasts you had broken and in whuich way and accordingly compensate.
and Allah Ta’ala Knows Best
Mufti Ebrahim Desai