There is probably many words to use for this, but I will call it "clicking with someone". Whether in a friendship or romantic relationship, I found in my life when this kind of connection happens, it's not always over shared interests, common cause or even similar values or matched personalities...