I would suggest getting all of your finance information together (income and fixed expenses like credit card debt, student loans, car payments, etc) and speaking with a mortgage officer. They often make suggestions on how to repair your credit quickly to be able to buy the townhome of your dreams.
You might also be able to find a property with an owner finance option.
I'd be happy to help in any way. Best wishes for the New Year!