It's in this context means "it has"
It HAS been raining for two hours... Present continuous tense, it means, "it is still raining"
It HAD been ... Past continuous tense..., it means, you are talking about a past action that is no longer valid in the present but you talk as if it is still happening. You are recounting a past action at the present time.