61.51 says you can log PIC time while you are acting as the PIC of a multi pilot crew. So does your company say you are the PIC while the senior PIC is sleeping?
It also says you can log PIC if you are the handling pilot if you are rated for that aircraft. Which means if your company doesn't make you the PIC while the other PIC is sleeping and the other FO is flying you can't log the time.