My 2 month old son seems to stretch and flex his legs a lot. Is this normal? I looked up symptoms and cerebral palsy came up? Worried!

Way too young. Infants are just learning they have arms and legs. That he moves them a lot is good. No reason to even think cerebral palsy at this age. Trust your pediatrician. Enjoy your child and love what he does, do not try to diagnose.
Normal pattern. Before the baby ever has control of their limbs,the brain sends out regular movement signals to every muscle in the body.This acts to preserve the muscle mass and tone in each so it will be available when baby gains motor skills to use them.This is seen as random stretching and flexing that seems to be for no purpose.However, without it, baby's muscles would be too weak to use later.