Praise be to Allah.
The one who suffers from epilepsy has to fast in Ramadan, and he is not exempted from fasting because of that.
Shaykh Ibn Baz (may Allah have mercy on him) was asked:
A man loses consciousness for a few hours – does he have to fast?
“If he only loses 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.” (Fatawa Ash-Shaykh Ibn Baz, 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.