how electrolytic capacitor has to be connected to AC?
You usually use two of twice the target final value, and connect them + to + (or - to -).
EDIT -- like this:
if it can be connected to ac then why the polarity is given?
A SINGLE electrolytic cannot be connected to AC without damaging it. TWO identical electrolytic capacitors connected back-to-back yields a non-polar net combination, which can be safely used with AC.
Separate names with a comma.