You can remain in the house until the owner files an unlawful detainer lawsuit and asks the court to remove you from the home. I would wait until that happens and then negotiate with the owner for a time to depart. The reason I would wait is because it is likely that the owner, if facing foreclosure, will not remove you from the home. It is possible that the foreclosure process will take six months or more. Make sure you continue to pay the rent, though. Call me if you have any other questions.
Ed Peckham, Esq.