1). The product of the two masses.
(It doesn't matter whether they have the same mass or their masses are way different. Only the product of the two matters.)
2). The distance between their centers.
(It doesn't matter whether they're huge and wispy, or small and tightly packed. Only the distance between their centers matters.)