Zend certified PHP/Magento developer

Magento 2.4 stock / source 2 same stock but different values

Im relatively new to Magento and could need some advice.
I have 2 Products wich has to rely on the same stock but with different stock-values.

For example:
Product A is 4 times in stock (value of 1 each)
Product B is only 2 times in stock (with a value of 2 each)

So if a customer buys Product A 1 times, there is only 1x Product B left available and 3x Products A.

How can I set a specific value for a Product or what would be another way to get that goal achieved.

I appreciate yall