Solar panels do not attract lightning, but they do not avoid grounding. Lighting will not strike your home unless it is the only building for miles around or is at a higher elevation than surrounding structures.