I don't think there's a law mandating it, but CRM (
https://en.wikipedia.org/wiki/Crew_resource_management) has been used and trained by all major airlines since the 1980s. The reason is simple: it doesn't really help to have two people in the cockpit if only one of them is making all the decisions.