The current standard in the mortgage industry is that your bankruptcy must have been discharged at least 2 years before you can qualify for a mortgage. However, there may be other options available to you. You may assume a sellers loan or, you could do a rent to own option. There are many mortgage lenders who specialize in extending credit to those people who file Bankruptcy. You will need to make sure that you keep your credit clean and that you take steps to rebuild your credit.
For more information on this topic, see our article on "Buying a home after bankruptcy"