"Had been married" or "Had + past participle" is the past perfect tense
used to show that two events happened in the past, and one of them happened first.
If you say:
"Annie and Alan have been married since July." (Present Perfect) it means that they are still married. It's the same as saying: Annie and Alan got married in July. They are still married today.
"Annie and Alan had been married since July" is an action that occurred in the past, happening before another event; it depends on the context of the sentence. If you say: "They had been married since July when their first child was born." 1) first event: their marriage in July - 2) second event after the marriage, but also in the past: the birth of their child.
(Let's not separate them