Generally, a bank that holds a mortgage lien on your home can foreclose on the mortgage at any time after you default on that loan. You are not technically in default until 30 days after you miss your payment, in most cases. Laws relating to foreclosure time lines vary, but in many states your lender can foreclose as soon as you go into default.
Any lien holder can foreclose on your home for non-payment of a debt secured against the property. Therefore, the fact that you made payments on time for your first mortgage does not mean that the lender holding the second lien cannot foreclose if you fall into default on that debt. Additionally, banks can ask courts to place a lien on your home in relation to another unpaid debt such as a credit card. If the court allows the bank to place the lien and you refuse to settle the debt, the bank can foreclose to collect payment of that debt.
When a lender forecloses on your home, it organizes a home auction and uses the money from the home sale to settle your debt. However, if the home sale does not raise enough money to clear the debt, the lender takes a loss. Additionally, due to the expense of real estate agent fees and legal fees, lenders tend only to foreclose as a last resort. Your lender may agree to modify your loan in order to avoid foreclosing, if a loan modification seems a more cost-effective option from the lender's point of view.
If your lender refuses to modify your loan and you cannot afford to make payments, you should attempt to sell your home to avoid foreclosure. If the mortgage debt exceeds the home's value, your lender may agree to allow you to sell for less than the amount owed by conducting a short sale. Alternatively, if your lender does not agree to a short sale, you can avoid going into foreclosure if your lender agrees to a deed-in-lieu-of-foreclosure. This involves you giving the lender the deed to the home and voluntarily moving out when this occurs. The lender avoids the foreclosure legal fees and you avoid hurting your credit score by having a foreclosure on your credit report.
The foreclosure process normally takes three to six months in most states, although in Arizona it can occur within a month. However, despite the speed at which banks can foreclose, many states have a right of redemption law that means you can resolve the issue even after the foreclosure sale has occurred. In Alabama, you can buy back your home for the amount of the debt owed at the time of foreclosure, any time within the 12 months immediately following the foreclosure.