The correct answers are: The commander ordered the humans to explain how the spaceship worked and asked if they had any fuel left. The commander instructed the humans to explain how the spaceship worked and wanted to know whether they had any fuel left.
The original quote contains an embedded question ("how this spaceship works") inside a command. In reported speech, the embedded question must backshift its tense ("how the spaceship worked") but must never use auxiliary inversion like "how did the spaceship work".
Furthermore, the yes/no question ("Do you have any fuel left?") must be introduced by if or whether and follow standard subject-verb word order ("if they had"). Options using "asked did they have" are incorrect because they retain the direct question auxiliary did. Finally, "commanded the humans explain" is missing the required to before the infinitive.