All the sentences provided are in the past perfect tense, which is a verbal tense form by the auxiliary verb “have” in past, that is, “had” and the past participle form of a verb.
The past participle form of the verb “ride” is not “ride,” “rodes” (which is a verb that does not even exist) nor “rode,” instead, it is “ridden” which comes from the irregular verb “ride.” Therefore, the correct answer is “The cowboy had ridden all night.”