The given sentence states a duration of time "for several months". Hence the most suitable option should be in continuous tense, as it has taken place over a period of time.
Option B: 'Had been thinking' is in past perfect continuous tense and agrees to the given sentence as explained above. Hence option B is correct.
Option A: 'Thinking' is missing the auxiliary verbs 'had' and 'been', without which the verb form is incomplete. The auxiliary (helping) verbs express the tense of the sentence.
Option C: Similarly, 'been thinking' is missing the auxiliary 'had'.
Option D: 'Will thinking' is in the future tense. But, the auxiliary 'be' is missing. Also, the action 'to think' does not sound right in the future tense in the context of the given sentence.
Hence options A, C and D are wrong.