If I'm a student pilot (for commercial), and I flew for pleasure with friends one night, do I log those hours as solo? Does solo mean, only pilot in the aircraft? Or does it literally mean only person?
According to FAA, it means that the pilot should be the only person in the aircraft. According to 14 CFR § 61.51 - Pilot logbooks,
(d) Logging of solo flight time. Except for a student pilot performing the duties of pilot in command of an airship requiring more than one pilot flight crewmember, a pilot may log as solo flight time only that flight time when the pilot is the sole occupant of the aircraft.
14 CFR § 61.8761.87 - Solo requirements for student pilots also says pretty much the same thing:
(a) General. A student pilot may not operate an aircraft in solo flight unless that student has met the requirements of this section. The term “solo flight” as used in this subpart means that flight time during which a student pilot is the sole occupant of the aircraft or that flight time during which the student performs the duties of a pilot in command of a gas balloon or an airship requiring more than one pilot flight crewmember.
I am assuming you have a Private Pilot's certification?
(SEL or MEL etc. does not matter as long as you are type rated and certified to fly the airplane you going to go fly in with your friends)
If so, technically this flight of yours goes in your log book as just another regular flight. Can you count hours towards another certification (towards Commercial)? Yes, since you are still PIC. What you cannot do is be compensated for that flight. Pro-rate based fuel sharing is acceptable.