A 25-year-old suspect is in custody after a rare mass shooting in southern Spain killed his parents and injured four, including two infants.