Al German concisely explains this issue reprinted here from faa.gov:
Proper logging of PIC time is a favorite subject of CFI’s sitting around these rainy days. And that’s not unusual since in the FAA’s own words in the Federal Register "The FAA acknowledges there has been confusion in the past regarding the logging of pilot-in-command time by these pilots and that inconsistent policy opinions have been issued by the FAA". In researching the subject FAR Parts 61 & 91, the Federal Register comments issued during the major revision to Part 61 in August 1997, "Federal Aviation Regulations Explained" published by Jeppesen, and various other aviation monthly publications were reviewed.
First lets be clear: who is, or can be, pilot-in-command (PIC) and who may log PIC time are two separate issues and are only sometimes related. FAR Part 1 defines the pilot-in-command as follows: "Pilot-in-command means the person who:
1. Has the final authority and responsibility for the operation and safety of the flight;
2. Has been designated as pilot-in-command before or during the flight; and
3. Holds the appropriate category, class, and type rating, if appropriate, for the conduct of the flight."
Part 91.3 expands those comments making it clear that anything that happens during the flight is the sole responsibility of the pilot-in-command. According to the Federal Register there are only three ways a private or commercial pilot can properly log pilot-in-command time.
1. When the pilot is the sole manipulator of the controls of an aircraft for which the pilot is rated.
2. When the pilot is sole occupant of the aircraft.
3. When the pilot is acting as pilot-in-command of an aircraft for which more than one pilot is required under the regulations under which the flight is conducted.
Far Part 61.51 "Pilot Logbooks" covers the logging of pilot time and section (e) addresses logging PIC time. A private or commercial pilot may log PIC time if that person is "the sole manipulator of the controls of an aircraft for which the pilot is rated" [61.51 (e)(1)(i)]
Thus a non-instrument rated pilot taking instrument flight instruction, if rated in the aircraft, may log PIC based on the "sole manipulator of the controls" rule. Since there is nothing in the rules that addresses meteorological conditions, the pilot may log PIC while in the clouds. This is supported by FAA chief counsel opinions [Federal Regulations Explained-Jeppesen].
A private or commercial pilot may log PIC time when "acting as pilot-in-command of an aircraft on which more than one pilot is required under the - - - - regulations under which the flight is conducted". [61.51 (e)(1)(ii)] Normally, a safety pilot, required by regulations, who scans for traffic for a pilot flying under simulated instrument conditions is not pilot-in-command and thus logs second-in-command. However, if the two pilots agree that the safety pilot is designated pilot-in-command, the safety pilot/pilot-in-command may log PIC since he is the pilot responsible for the operation and safety of the aircraft. The pilot flying is "sole manipulator of the controls for which the pilot is rated"" and may also log PIC. Therefore, two private pilots may log PIC under these conditions. However, the safety pilot/pilot-in-command must realize that anything that occurs during the flight is his responsibility. Airspace violations, non- compliance with ATC instructions, near mid air collision, and runway incursions on the ground are all now charged to the safety pilot.
A recent article in a monthly aviation publications discussed a flight where there was a violation and the two pilots disagreed who was pilot-in-command. However, two pilots may not simultaneously log PIC when one pilot is sole manipulator of the controls and the other is acting as pilot-in-command if the regulations governing the flight do not require more than one pilot. "An airline transport pilot may log as PIC time all of the flight time while acting as pilot-in-command of an operation requiring an airline transport certificate." [61.51 (e)(2)] Previous regulations allowed a situation where three pilot (one an ATP) could log PIC simultaneously when conducting an operation which did not require an airline transport pilot. This is no longer allowed under the August 1997 revision.
A flight instructor may log PIC "while acting as a authorized instructor". No change to previous regulations. A student pilot can now log PIC. That’s new, and since there is no restriction, your logbook can be updated so that all student solo time prior to August 4, 1997 may be logged as PIC. When an instructor is aboard, since the student is not rated in
the aircraft, flight instruction is still logged as dual not PIC. Then there are some unusual situations which occur. A private pilot flying with his friend (a CFI or ATP) aboard as a passenger. What is the status of the CFI or ATP who is obviously a more senior pilot with more experience than the private pilot? The regulations don’t address this situation, but the courts may find that the more senior pilot has some or all the responsibility for the operation or safety of the flight.
In summary, the person who is pilot-in- command may log PIC, others may also log PIC depending in the circumstances.