You have 4 real cores (HT cores dont count) to give out.
You need to guarentee that 2 VMs have guarenteed levels of performance, even when running together. Therefore, you cannot overcommit.
Therefore, you can allocate no more than the 4 cores you have. 2 VMs x 2 vCPUs per VM = 4 cores allocated.