I'm guessing they never made it to the Engineers' home world. Maybe David discovered their cargo and didn't want it to be unleashed on the Engineers, so he sabotaged the ship and caused it to land/crash on this world. Of course, that doesn't explain why the world is terraformed. Maybe, if my above scenario is correct, he caused the ship to malfunction close to a world he had located that had already been terraformed by the Engineers and was like, "The ship is malfunctioning and I can't fix it. But look--luckily, we are close to a world you can survive on. Let's go there until I can fix the ship." Or maybe it was just a random planet that wasn't Terraformed, but the Engineers had a terraforming apparatus onboard, and David learned to use it and get the process going. Seems like there probably isn't enough passage of time for the latter, but whatever. Just trying to come up with plausible theories.