Two million claimants in receipt of benefits who live in Scotland will be shielded.