As the piston rises on its compression stroke the exhaust valve is still closed and the inlet valve is closing.