Daughters over Boyfriend


I have been living with my boyfriend for a year in Spain, waiting for him to get divorce, and be able to go out together in public. I submit a student visa application and it has been denied, so I want to go back to my country to spend time with my daughters because they are having a bad time with their father. I want to make a decision from a clean space, so what process should I follow to make my decision? Thanks in Advance