This is an extract from the old FAQ's:
Note, while the private pilot may log this time as pilot-in-command time in accordance with 14 CFR § 61.51(e), he or she may not act as the pilot in command unless he or she has the appropriate endorsement as required under 14 CFR § 61.31. There is a distinction between acting as pilot in command and logging pilot-in-command time. In order to act as pilot in command, the pilot who has final authority and responsibility for the operation and safety of the flight, a person must be properly rated in the aircraft and be properly rated and authorized to conduct the flight. Title 14 CFR § 61.31 requires a person to have an endorsement from an authorized instructor before he or she may act as pilot in command of certain aircraft (a complex airplane, a high performance airplane, a pressurized airplane capable of operating at high altitudes, or a tailwheel airplane). These endorsements are not required to log pilot-in-command time under 14 CFR § 61.51(e). In order to log pilot-in-command time, a person who is the sole manipulator of the controls only needs to be properly rated in the aircraft.