#2 copper should do the job. Check with a local electrician on the neutral wire size.
The sub panel should have it's own ground rod, with the neutral and ground bus bars isolated from each other.
Your local library may have a current copy of the National Electric Code, and it would be a good idea for you to check. If it does, there are several sections that are very important for you to know if you are doing your own pool wiring.
With all that said, hiring an electrician that has experience with pool installs would be the best way for you to keep you and your family safe. You don't want any electrical problems anywhere near your pool!