Base pairs are dictated by hydrogen bonds, there are two groups of bases; purines and pyrimidines. In Watson and Crick base pairing, a purine always binds to a pyrimidine. Adenine and Guanine are classed as purines. Whereas; Thymine, cytosine and uracil are all classed as pyrimidines.
In DNA Adenine binds with Thymine forming two hydrogen bonds, and Cytosine binds with Guanine forming three hydrogen bonds.
In RNA Adenine binds insteasd with Uracil, agian with two hydrogen bonds. The pairing for Cytosine and Guanine is the same in RNA.
Complementary base pairing is a key concept in semi-conservative DNA replication.