Normally you always ship to country Y. Except for product X. This is either too heavy, too bulky or may not be sent to country Y for legal reasons.
Each product has a text field in the admin area in which you can enter the country abbreviations to which the product may NOT be sold.
In the checkout process - payment method selection and billing address - the system checks what billing address the customer enters.
If there is a product in the shopping cart that is prohibited for this country, there is an error message and the customer cannot proceed.
All modules in the legal area were programmed on customer request. Please ask your lawyer whether they are legally required. We cannot give any information on this.