The free body diagram of 2 kg block is shown below,
The equilibrium equation for the block is, f′=µR1 f′=(0.5)2g f′=10N since f′>2N, so 2‌kg block will move along the direction of 4kg body. The net friction force on 2 kg block is, f=f′−2 f=10−2 f=8N