I could have added several more combinations (such as C-D, none-D, and C-none) to the list, but in short, the couples match only works in pairs. You both need to match at a pre-determined combination of your choosing, even if that combination includes one of you not matching anywhere. The match algorithm doesn't care about specialty or location. (Hypothetically, you could design a couples match to deliberately be in different programs on different sides of the country!)
It can be harder to match as a couple in the sense that one of you could drag the other down. Let's say that you only submitted my sample list above with no additions. If you could have matched at C and your partner could have matched at D, but you didn't include that combination (maybe because they were in different cities), you would both end up unmatched. Or if you could have matched at C solo but your partner was never going to match no matter what, there's no combination listed that allows that to happen, so you would both end up unmatched. So to avoid risking anything due to the couples match, if you put every possible combination including each potential where one of you goes unmatched, then if one of you wasn't going to match no matter what, the other will still be able to match.
Going deeper into detail about that, it's worth noting that neither of your lists gets priority; you both need to fit a particular combination for the couples match to work. For a solo match, the algorithm only looks at the top program on your list without risking anything below. Either the condition is met that you match there, or the program filled with other candidates and only then would the algorithm look at the second position on your list, and so on and so on. But for a couples match, *both* of you need to meet the condition that you match to the combination in your top joint match, and either you both succeed or else the algorithm proceeds to the second combination, and so on and so on.
Also, there's a potential that one of you might "drag the other down" in the sense that one of you might have matched into a better program applying solo. Looking back to the first three lines of my original sample list:
Finally, I don't claim that this blog post is an exhaustive list of details about the couples match, merely a helpful perspective on what actually happens. For the official information, please visit the NRMP website.