Sentence which correctly uses the past perfect tense is, B. He had dreamed about the Great Wall of China long before he visited it.
Past perfect tense refers to the actions which have begun in the past and finished in the past itself when another action happened.
It is formed by, had + past form of the verb
In the above sentence, the first action that "He had dreamed about the Great Wall of China" is finished by the second act of "he visited it."