If he were a healthy dog, I'd say it was fear based and probably separation anxiety.

But because he has epilepsy, a neurological disorder, I can't say anything definitively. My best advice is to ask your vet what the side effects of the medications are and, if at all possible, consult a veterinary behaviorist.