I am in a similar situation, we filed the i-130 10 months after moving back in my country. I-130 can take a couple of months or a year depending on the Service Center and the processing is not impacted by the two year residency rule. Once you get to the NVC stage, however, I believe there is a question related to the two year home residency requirement in DS260. Might not be a good idea to submit that before finishing the two years. But it will take a while to get to that point anyways. The only caviat is from my knowledge with an approved I-130, you are normally expected to apply for the immigrant visa within the next year, or would need to get in touch with NVC to explain the situation if you get your I-130 approved with more than a year left on the two year rule.