Under EASA rules the operator (airline, AOC holder) assigns who is the PIC, and only that person can log PIC time. Even if he/she is in the bunk. The other pilots on board can log P2/SIC. Even if one is paid and trained as a captain. Two captains flying together has a few issues, as the above one, but also possible flightdeck authority gradient problems, who can abort a take off. So a very thorough briefing is in order and most unions are pretty much against it. Since you do need specific right hand seat training anyway to fly in the right hand seat as a captain, many airlines do not bother with that anymore except for trainers of course.