Pareja de Hecho when Eu Citizen moves away

We did our pareja de hecho 2 years ago. Now I (Eu citizen) will be living 7 months a abroad and 5 months in Spain. My girlfriend will live 5 months abroad with me and 7 months in Spain.

Will she loose her residency? How can we keep it?