What happens after foreclosure can very from state to state and county to county. It also depends on what you mean by after foreclosure. Was the house actually sold at a foreclosure auction, was a short sale accepted, or was it sold as a pre foreclosure?
Depending on how far you got in the process makes a big difference on your credit report and the possibility of getting approved for another loan in the near future.
If the home was sold at a foreclosure auction then the money from the auction sale will go to the creditor with the highest priority. The first things paid are real estate taxes and then the mortgage. If there is not enough money to pay off the mortgage, the previous homeowner is still liable for the difference.
If you want to know how long you can stay in the home after foreclosure, that can depend on who the new owner of the property is. there is also a period of redemption immediately following the foreclosure auction in which the previous homeowner can buy the home back if they were able to secure financing. If not, and ownership changes, then it is up to the new owners to evict. An eviction usually takes about 20 days and that can be stretched out if there are some extenuating circumstances.
A foreclosure is a blemish that will stay on your credit report for seven years. This does not mean that you have to wait seven years before you can purchase a new home. If there were circumstances such as a death, illness or job loss that put you in a foreclosure situation, you may be able to be approved for another mortgage in as early as three years.
A foreclosure is not the end of the world. What happens after foreclosure is up to you. Keep your head up, start rebuilding your credit, and move on with your life.