Absolutely work on fixing your credit score. For the next duration don't spend on anything except necessity, especially that which requires a credit check. Work with a lender who can direct you on what to do and what not to do. There are home buying programs available to those who qualify but there are also conditions. Fix that score. it's not as difficult as you may fear if you are really serious. Rent til then is one consideration.
The very first thing to do is pull your credit report to find out why you have bad credit. Once you have that you can then develop a plan to get to an mortgage approvable credit report. Depending on your current credit report it can be a short period of time such as a month or so to several months.