Rule No 3.: passengers don't log time (I couldn't tell from the post whether you or your friend were flying). Not in seat 26C in a 757 nor in a Cessna 172.
Rule No 2. Student pilots can only log time they (a) receive instruction or (b) are lawfully flying solo
Rule No 1. (might as well learn it now) The rules about logging flight time are collected in one reg - FAR 61.51. The answer isn't always crystal clear (which is why there are formal interpretations available) and sometimes to have to go elsewhere also, but the answer always starts there.