When to log time as PIC, Dual or Co-Pilot?
Canadian law is as follows:

At no time can anyone in a private C172 log SIC or co-pilot time, because the 172 is certified only for single pilot operations and the aircraft is not flown under the provisions of an Operating Certificate that mandates two pilot operation.

You can log dual (instruction) time when you are receiving instruction from a Flight Instructor certified to do so. (In Canada CFI refers exclusively to the Chief Flight Instructor of a Flight Training Unit.)

Otherwise, you can log PIC time, when you are PIC, otherwise you cannot log time at all. 

If you are in simulated IMC, either you or your friend can log time, assuming you are both qualified to be PIC, and depending on who you agree between you is Pilot In Command, but never both of you, unless he is a qualified flight instructor. Even then, only one person can log PIC time, in Canada.

Note that in Canada it is not required for the "lookout" or "safety person" to be a qualified pilot of any kind, if the PIC wants to fly under the hood. It remains the PIC's responsibility to fly safely and look out for traffic, and he or she can discharge that responsibility by asking any responsible person to help them.

These rules are rather different from the ones that prevail in the US.

Hope that helps!