Okay, then you will have to find a qualified substitute tenant and offer that person to the owner. If you can confirm that the tenant is qualified, whether or not the tenant is willing to take the lease for the entire remaining term, you can avoid liability for that portion of the lease that the tenant was willing to accept (assuming that you can get the prospective tenant to make him/herself available to testify in court on your behalf, which shouldn't be too difficult).
If the tenant takes the entire lease, you're off the hook. If not, then when the tenant's lease is running out, you will have to find someone else to take over the remainder of the lease.
The worst case would be that you can't find anyone, but, you still have somewhere to live in the meantime, and even if the property is foreclosed, federal law will not permit you to be forced to move without at least 90 days after the foreclosure occurs (12 U.S.C. 5220 notes).
The above is the conventional options. There is another. If your lease and option demonstrates that the owner knew when you entered into the lease, that the intent was a purchase, and there was a likelihood at that time, of which you were unaware, that the owner would not be able to continue the mortgage
payments, then that would be what we call in the legal biz: a fraud
. The reason is that you relied to your detriment that the property could be purchased within the two year term, and that obviously is no longer the case.
Even if a court were to determine that the owner's misrepresentation was innocent, you would still have the right to break the lease and sue for damages
, because you can't buy what the owner doesn't own any longer.
This last option requires litigation, but, if you want to walk away, and the owner won't give you your deposit back, then you could use the fraud allegation as a defense to any claim for unpaid rent -- as long as you paid for the time in the property when you were actually resident.
That about covers every possibility. Hope this helps.