The original version was British English 'rub shoulders with', which became in American English 'rub elbows with'. Clearly, both are just a reference to people being close together. In physical terms, that might mean shoulders and elbows are actually in contact...in metaphorical terms, it might suggest that people were in close agreement.