I'm a mortgage professional.
We have programs that allow you to qualify the day after your bankruptcy is dismissed and/or the foreclosure is completed.
If you apply that soon you can expect to put down 20-30% depending on your credit score.
If you waited two years you can expect to put down at least 3% but there are also some no money down options available.
I you have any questions or would like help with this you are welcome to contact me.
I'm avialable almost 24/7.