If going from an RCA output to XLR input:
RCA hot/center to pin 2, RCA ground to pin 3, and two options (try both): shield to pin 1 at XLR only
shield to RCA ground only
If going from an XLR output to an RCA input:
If the output is electronic circuitry, then pin 2 to RCA hot/center, and pin 1 to RCA ground. Shield to pin 1 of XLR only.
If the output is transformer based, then pin 2 to RCA hot/center, and pin 3 to RCA ground. Shield to pin 1 of XLR only.
For XLR to XLR, twisted pairs should be constructed like this:
pin 2 to pin 2, pin 3 to pin 3 for the twisted pair wires, THEN, the shield to pin 1 of the source component. This SHOULD work for true balanced gear, but some is not true balanced, and a ground reference connection must be made, in this case, wrap a 16 gauge tinned stranded hookup wire around the OUTSIDE of the shield braid, and connect to pin 1 at both ends. This will help keep any ground currents from interfering with the two differential pairs, and minimize cable capacitance.
BTW, as for all DIY twisted pairs, I recommend spacing the shield braid AWAY from the twisted pairs using a high quality insulation like , and then oversized braid for a 100% shield covering.
Hope this helps