Chapter 13 bankruptcy makes things a little complicated when it comes to obtaining another mortgage. You can apply for a loan with as few as 12 timely payments on a Chapter 13 plan, with the court's consent. Essentially, it is on a case by case basis and it is best to consult a trusted mortgage professional in your area with your specific scenario to determine your eligibility.
I'm a loan officer, so I am very familiar with this topic.