it depends on the time and the program on when you'll be eligible. for example FHA, USDA and VA require the date to be at least 3 years (big word "at least" on conventional financing they require a 7 year period to past the sheriffs deed date, they do have some circumstances where they'll allow you to do it sooner (loss of job, death, health problems, etc.) it's not guaranteed but they will review any explanation. The other thing is your credit score, the investor will want to make sure you have "re-established" your credit with no late payments and no new "negative" collections, judgement, etc.
we'd be happy to help walk you through the process, more information at: http://www.the2mortgageguys.com