Codimension 2 Symmetric Homoclinic Bifurcations and Application to 1:2 Resonance