I would like to have 2 drives combined to have 40 TB
Several options here. One is RAID0 that will give you 20+20 combo, or JBOD that will also give you 20+20. The difference is that in RAID0 scenario losing one drive you will lose the whole RAID0 array and all the data. In JBOD, losing one drive will cost you data only on that particular drive.
RAID0 (redundant array of independent disks, level 0) is a way of combining multiple disks into a single logical volume, which appears to the operating system as a single large drive. Data is striped across the disks to improve performance, but there is no redundancy or fault tolerance. If one disk fails, all data on the entire RAID0 volume is lost.
JBOD (just a bunch of disks) is a simple method of combining the disks where each disk is treated as a separate volume. Data is stored on each disk independently without any striping or parity. JBOD has no redundancy or fault tolerance, and any failure of one disk may result in the loss of data on that particular disk.
In summary, RAID0 is faster due to striping but has no redundancy, while JBOD treats disks independently without any striping or fault tolerance.
For mirroring, you have RAID1 or SHR. From raw storage perspective there is no difference in your case as the drives are identical, so both option with give you 20TB of space with 20TB or redundancy for that array, meaning mirror. the difference is that with SHR you will be able to mix various drives in size to maximize the used space, but considering that you will only have 2 drives in that configuration it will not matter, as the usable size will always be the max capacity of the smaller drive in that array.
RAID1 is the conventional configuration option and SHR is proprietary to Synology's DSM. Migrating from one to the other also has certain rules (check the official KB for that), but in your particular case it will be practically irrelevant what mirror type you will choose considering that drives are identical.