A mortgage lender will typically look at your credit score two years after you have filed for bankruptcy. If you have re-established good credit and can demonstrate that you are now in a better financial position, then a mortgage lender may be more likely to approve your loan application.
It is important to remember that filing for bankruptcy is not the end of the world. In fact, many people who have filed for bankruptcy go on to rebuild their credit and eventually qualify for a home loan. Bankruptcy should be seen as an opportunity to start over with a clean slate and make better financial decisions in the future.