I would like to find out if it is compulsory for a person to fast if he suffers from epilepsy.
Yes, the one who suffers from epilepsy has to fast in Ramadaan, and he is not exempted from fasting because of that.
Shaykh Ibn Baaz (may Allaah have mercy on him) was asked:
A man loses consciousness for a few hours – does he have to fast?
If he only lost consciousness for a few hours, then he has to fast, like the one who sleeps for a while. The fact that he loses consciousness for a few days during the day or during the night does not mean that he is not obliged to fast.
Fataawa al-Shaykh Ibn Baaz, 15/210.
But if he is unconscious for the whole day (i.e., from dawn until sunset), then his fast is not valid and he has to make up that day. But if he wakes up during the day then his fast is valid.