How much time would I need to prepare before enlisting to make sure I have the best chances of passing selection?

It really depends on what your current fitness level is, however, generally speaking I tell guys who are modestly in shape to give themselves at least 8 months to get ready.