As long as you are living there then rent is due. You do have rights as a tenant even after is forecloses. The bank can either take it back or someone else like an investor can pick it up at the courthouse sale.
Yes. Until the property actually changes ownership you still have to pay rent to the current home owner. If and when the property changes ownership you will have to pay rent to the new owner, even if that owner is the bank.