On a conventional loan it is normally 4 years from the discharge date, 2 years if you have extenuating circumstances.
The waiting period alone does not make you automatically eligible though. You'll need to re-establish good credit as well. That means a minimum of a couple tradelines with at least a 12 months history and also, ZERO late payments or collections accounts since the discharge. Either of these can set you back to square one.
Hope this helps!