I would consult a tax advisor. this is too complicated for an Q&A forum.
One note, if you file for an extension of time to file your return, please note it is not an extension of time to pay taxes. Form 4868 is used to file for an extension for F1040.
You would need to estimate your total tax liability and your payments, and possibly need to send in money with the F4868 so that later, you wouldn't have a penalty for underpayment of tax.