What is the best way to tell your boyfriend with whom you have been for 2 yrs, that you have epilepsy?

Depends. You should definitely tell him, but the way that you tell him depends on how supportive your boyfriend is. But be honest and straight forward. If he loves you, then he'll be supportive.
Just Tell him. Just tell him, he has been with you for 2 years for some reason, if he really wants to be with you, you will find out. Having epilepsy is not a crime and likely you did nothing to bring this on. I would let him know what your typical seizure entails, ie. Shaking, loss of continence, post-ictal period, and how often they occur. If you are serious about this man, he deserves to know.