F-1 visa means that you will not be able to work for entities other than your university (remotely or in person). You can participate in GSoC after you are elegible for CPT (which in most cases is after 1 year of study but in some cources is allowed in 1st semester), you will have to dicuss the dates of the program with the International Students Office of your university.
If you are not eligible for CPT yet, you have two options
1. Don't stay in USA during GSoC program. This includes community bonding period.
2. Stay in USA, participate but dont accept any money. Google allows this, you can send them an email once your proposal is accepted.
Whatever you do always consult the International Students Office and confirm that you are not in violation of any laws.