united-states
A work made for hire is "a work prepared by an employee within the scope of his or her employment" or a commissioned work. See 17 U.S.C. § 101. "In the case of a work made for hire, the employer or other person for whom the work was prepared is considered the author for purposes of this title, and, unless the parties have expressly agreed otherwise in a written instrument signed by them, owns all of the rights comprised in the copyright" (17 U.S.C. § 201(b)).
The U.S. Supreme Court has said that when determining whether the work was made for hire, general common law agency principles apply (Community for Creative Non-Violence v. Reid, 490 U.S. 730 (1989)). The U.S. Copyright Office has set out some example factors to determine whether the work is made for hire for a purported employer (Compendium, § 506.2). Some of these relate to agency in general; others seem to relate to which employer (if there are multiple) would have claim to the copyright:
- the location where the work was created;
- the source of the instrumentalities and tools used to create the work;
- whether the work is part of the regular business of the hiring party;
- whether the work is the typoe of work the hired party was authorized to perform;
- whether the work occurs substantially within the authorized work hours and space limits of the hired party;
- whether the work is actuated, at least in part, by a purpose to serve the hiring party.
canada
See Copyright Act, s. 13(3):
Where the author of a work was in the employment of some other person under a contract of service or apprenticeship and the work was made in the course of his employment by that person, the person by whom the author was employed shall, in the absence of any agreement to the contrary, be the first owner of the copyright, but where the work is an article or other contribution to a newspaper, magazine or similar periodical, there shall, in the absence of any agreement to the contrary, be deemed to be reserved to the author a right to restrain the publication of the work, otherwise than as part of a newspaper, magazine or similar periodical.
What matters is whether the work was made "in the course of his employment by that person." The question to ask is: when the work was created, "for whom was the person working at that time?"
A Canadian court has not had to grapple with the problem of competing employer claims to copyright over a shared employee's work, but I predict they would look to similar factors as listed above to determine for whom the employee was producing the work.