It's all in section 10 of the data sheet.
Basically, you will notice some pins of the IC have RP numbers, these are the Remappable Pins.
For inputs to the IC, use RPINRxx = RP number. For example the RPINR for the second USART (RX) is RPINR16 and you want it mapped to pin RP23 so use RPINR16=23.
For outputs from the IC use RPORxx = function number, where xx is the RP number and the function number comes from table 10.14 in the data sheet. So you would use RPOR24=05.
It makes sense when you read section 10.
Note that the remapping registers are protected so you must follow the procedure shown in example 10.7 to unlock them before they can be assigned and then re-lock them again afterwards.
Brian.