You have multiple options.
Set up one record in a pricing table for each combination of size and Quantity (or Quantity Range)--each with it's own product ID. By treating each combination as a separate product, you can add as many combinations as you need and still use a simple price look up to look up prices. In the above example, that's 21 different pricing records that would all link to the same Product record.
Note that with conditional value lists and enhanced value selection techniques, you can still set up a system where the user selects a basic product, specifies size and Qty and then the system enters the needed Product ID and looks up a price from a pricing table.
This option can be easier to set up in some cases, but locks you into limits that do not exist in Option 1. Set up one Product record, but then add multiple price fields--each for a different size/Qty combination--21 fields in your given example. An auto-Enter calculation can use Case and fields where you specify size and Qty to select from which field to look up a price. But now, if you set up 21 fields for this and later find that you need 24 for a given product, you have to make design changes to your database to accommodate the change where in Option 1, you just add 3 more records and keep going.
This is an often overlooked option, but worth considering if it works for your business set up:
If you can define your pricing as a formula where base price, size and Qty are variables in an equation, you can look up a base price and compute the price from the equation. You can even store such an equation as text in the product record and use a different equation with different products. (You would use the Evaluate function with this stored formula text in order to compute the price.) This retains much of the flexibility found in Option 1, but keeps you at one record per basic product. It's not as flexible as the formula used will limit some of your pricing options. "We have too many XXL's or Product A in the 1 Gross Cartons. Put them on sale..."--would be tough to do with this formula method.)