Fix your credit, period. Whether renting or buying is better depends on many factors, but wouldn't it be nice to have both options? Buying for most is better in the long run. Paying rent is just paying someone else's mortgage and they can give you notice and you have to leave. Buy a home you love and can stay in, build equity in and eventually sell and make money on.
Until you qualify for a mortgage rent and fix your credit.