Logging Pilot-in-Command Time

There is one, and only one, section in the regulations that controls the way pilots log their experience, and that's in 14 CFR 61.51, Pilot logbooks. If you look anywhere else in the regulations, you will come away with incorrect or hopelessly confused notions. The paragraph that pertains to logging pilot-in-command time is in paragraph (e):
(e) Logging pilot-in-command flight time.
(1) A sport, recreational, private, or commercial pilot may log pilot-incommand time only for that flight time during which that person—
(i) Is the sole manipulator of the controls of an aircraft for which the pilot is rated or has privileges;
(ii) Is the sole occupant of the aircraft; or
(iii) Except for a recreational pilot, is acting as pilot in command of an aircraft on which more than one pilot is required under the type certification of the aircraft or the regulations under which the flight is conducted.
(2) An airline transport pilot may log as pilot-in-command time all of the flight time while acting as pilot-incommand of an operation requiring an airline transport pilot certificate.
(3) An authorized instructor may log as pilot-in-command time all flight time while acting as an authorized instructor.
(4) A student pilot may log pilot-incommand time only when the student pilot—
(i) Is the sole occupant of the aircraft or is performing the duties of pilot of command of an airship requiring more than one pilot flight crewmember;
(ii) Has a current solo flight endorsement as required under § 61.87 of this part; and
(iii) Is undergoing training for a pilot certificate or rating.

Logging vs Acting

Before taking a closer look at the practical application of this section, I need to point out a significant distinction that isn't at all obvious when reading Part 61 regulations:
Important Concept
Logging PIC is not the same thing as acting as PIC.

The regulations we will be discussing here are only related to logging of PIC time. There are a wide variety of other regulations which determine a pilot's ability to act as PIC, but generally don't have anything to do with a pilot's ability to log the time as PIC. There are many common situations in which you can log PIC time, but cannot act as PIC, and, strangely, there are a few unusual circumstances when you can act as PIC, yet not be able to log it as such.

To make sure you accept this fundamental idea, check out this except from one of many legal interpretations FAA's General Counsel's Office:
There is a distinction between acting as pilot in command and logging of pilot in command time. "Pilot in command," as defined in FAR 1.1, "means the pilot responsible for the operation and safety of an aircraft during flight time." FAR 61.51(e) is a flight-time logging regulation, which only regulates the recording of PIC time used to meet the requirements toward a higher certificate, higher rating, or for recent flight experience...
Since the only paragraph that really confuses people is paragraph (a)(1), we'll focus on that. Let me repeat it here, with the important phrases highlighted:
(e) Logging pilot-in-command flight time.
(1) A sport, recreational, private, or commercial pilot may log pilot-in command time only for that flight time during which that person—
(i) Is the sole manipulator of the controls of an aircraft for which the pilot is rated or has privileges;
(ii) Is the sole occupant of the aircraft; or
(iii) Except for a recreational pilot, is acting as pilot in command of an aircraft on which more than one pilot is required under the type certification of the aircraft or the regulations under which the flight is conducted.

Note that this paragraph applies to sport, recreational, private and commercial pilots. The only pilot certificates missing are student and ATP, which are addressed in other paragraphs. The Flight Instructor certificate is also in a separate paragraph.

The second thing to note is that the three subparagraphs are connected with an "or"; any of the three is sufficient to log the time as PIC. The subparagraph that applies in most situations is paragraph (i). Let me paraphrase it below:

A pilot can log PIC flight time when he is the sole manipulator of the controls of an aircraft for which he is rated.
Although that seems simple enough, most pilots completely ignore it when the time comes to actually decide how to log their flight time. Here's a common scenario:
Question: I'm undergoing instrument training and my instructor takes me into IMC. Can I log the flight time as PIC?
Answer: Apply the Primary Rule. Are you the sole manipulator of the controls? Yes. Are you rated in the aircraft? Assuming it's a single-engine land, and you have a single-engine land on your pilot certificate, then, yes, you're rated and yes you can log the time as PIC.
Wrong answer: Most people want to say "no", the pilot isn't instrument rated and thus can't act as PIC while in IMC. While this is true, it's also irrelevant, according to the Important Concept. The instrument student is not qualified to act as PIC while in IMC, but he can log the time according to the Primary Rule.
Show Letter
Question: I'm undergoing training in a complex aircraft; can I log the time as PIC prior to getting my complex endorsement?
Answer: Apply the Primary Rule. Are you the sole manipulator of the controls? Yes. Are you rated in the aircraft? Assuming it's a single-engine land, and you have a single-engine land on your pilot certificate, then, yes, you're rated and yes you can log the time as PIC.
Wrong answer: Most people want to say "no", the pilot doesn't have the proper endorsement and thus can't act as PIC of a complex aircraft. While this is true, it's also irrelevant, according to the Important Concept. The instrument student is not qualified to act as PIC of a complex aircraft, but he can log the time according to the Primary Rule. An endorsement is not a rating. The same logic applies to the high performance, tailwheel, and pressurized aircraft endorsements.
Question: I have lapsed Flight Review. While I'm undergoing profiency training, can I log the time as PIC?
Answer: Apply the Primary Rule. Are you the sole manipulator of the controls? Yes. Are you rated in the aircraft? Assuming it's a single-engine land, and you have a single-engine land on your pilot certificate, then, yes, you're rated and yes you can log the time as PIC.
Wrong answer: Most people want to say "no", the pilot doesn't have a current Flight Review and thus can't act as PIC of any aircraft. While this is true, it's also irrelevant, according to the Important Concept. The Flight Review candidate is not qualified to act as PIC of an aircraft, but he can log the time according to the Primary Rule.
Show Letter
Question: I'm flying as First Officer under Part 135 in a King Air 200. Can I log the time when I'm flying as PIC
Answer: Apply the Primary Rule. Are you the sole manipulator of the controls? Yes. Are you rated in the aircraft? Since you must have a Commercial multiengine rating on your pilot certificate in order to serve as a First Officer of a Part 135 operation, and no type rating is required for the King Air 200, then yes, you're rated and yes, you can log the time as PIC.
Wrong answer: Most people want to say "no", the pilot isn't acting as PIC of the flight, since he's only a First Officer. While this is true, it's also irrelevant, according to the Important Concept. the Primary Rule doesn't require that the pilot be acting as PIC to log the fight time.
Show Letter

When Acting as PIC Matters

There are only two situations in which acting as PIC is relevant to logging of PIC time. The first is
(e) Logging pilot-in-command flight time.
...
(2) An airline transport pilot may log as pilot-in-command time all of the flight time while acting as pilot-incommand of an operation requiring an airline transport pilot certificate.
So an ATP can log PIC time when acting as PIC of a flight that requires an ATP. The second is part of the same paragraph that applies to non-ATP pilots:
(e) Logging pilot-in-command flight time.
(1) A sport, recreational, private, or commercial pilot may log pilot-in command time only for that flight time during which that person—
...
(iii) Except for a recreational pilot, is acting as pilot in command of an aircraft on which more than one pilot is required under the type certification of the aircraft or the regulations under which the flight is conducted.
Note the two possibilities: type certification of the aircraft or the regulations under which the flight is conducted. The first instance might occur in a Citation X, for example. Whoever is acting as PIC can log the entire time as PIC, since he is acting as PIC in an airplane that requires two pilots. The second possibility is typical with safety pilots, the "regulation under which the flight is conducted" being
§ 91.109 Flight instruction; Simulated instrument flight and certain flight tests.
...
(b) No person may operate a civil aircraft in simulated instrument flight unless—
(1) The other control seat is occupied by a safety pilot who possesses at least a private pilot certificate with category and class ratings appropriate to the aircraft being flown.
If a safety pilot chooses to act as PIC, then he can log the flight time as PIC. He can only take this route, however, if he is qualified to act as PIC, and all the other regulations within Part 61 that deal with the requirements to act as PIC suddenly become relevant.

Summary

A pilot can always log flight time as PIC when he meets the conditions of the Primary Rule, end of story. There are small number of other situations in which the pilot may be able to log PIC time when the Primary Rule doesn't apply, such as when the pilot is acting as a safety pilot and assumes the role of PIC. Only in the latter situation must the pilot actually meet all the Part 61 requirements to be pilot-in-command.