Rule Summary

For the normal, single tech level, case:
X2: 3xXCA (including variants, one may be an XCAL), 6 SC4 hulls; XCAL (D80.32) and EFO-X2 (D80.115) provide exceptions
X1: 4 SC3 hulls (5 or 6 if CW or CL based), SC4s limited by command rating

Mixing:
XCA is limited to one and counts against the 4 or fewer SC3 hulls limit; variants of the hull may be added (i.e., XCAL, XCA, and XCT may be in a mixed tech SQ, but only up to one of each type)

Examples

Illegal:
2 (or 3) XCA, CAX (or other SC3 X1 hull), (assorted SC4 X1 and X2 hulls)- only allowed one XCA when mixing (XCA is considered a "command ship" (D17.40))
XCA, 3xCAX, 7 (or more) XDD/XFF - only allowed 6 SC4 X2 hulls
XCA, 3xCAX 9 (or more) XDD/XFF - if you have EFO-X2 (D80.115), you are allowed two more SC4 X2 hulls (aka 8), 9 can't be done in a mixed SQ
XCAL, more than 6 SC4 X2 hulls, one (or more) X1 DWX/DDX/FFX (if it were not for the single X1 ship, SQ would be legal). D80.32f requires SQ to only have X2 ships for the extra SC4 slots
2 (or 3) XCA and any X1 hulls- you may not have two XCA in a SQ with X1 ships
2 (or 3) XCT and any X1 hulls- you may not have two XCT in a SQ with X1 ships
2 (or 3) XCAL and any X1 hulls- you may not have two XCAL in a SQ with X1 ships (or just X2 ships)
XCA, 4 or 5 SC3 X1 hulls- the XCA is considered a "CA" hull type, so you must use (D70.40a)'s stacking limits, not (D70.40b or c), even if the X1 hulls are all CWX/CLX)

Legal:
XCA, (0, 1, 2, or 3 SC3 X1 hulls that would otherwise be a legal SQ), (0-6 XDD/XFF up to command rating limits), assorted X1 DWX/DDX/FFX (up to command rating limits)
XCA, 6 XDD/XFF (8 with EFO-X2 tech), assorted X1 DWX/DDX/FFX (up to command rating limits)
XCA, CCX, (0, 1, or 2 SC3 X1 hulls, none of which may be a CCX), 6 (or 8 with EFO-X2) XDD/XFF, assorted X1 DWX/DDX/FFX (up to command rating limits)
XCAL, XCA, XCT, 6 XDD/XFF (8 with EFO-X2 tech), 1 (or 0) SC3 X1 hull, assorted X1 DWX/DDX/FFX (up to command rating limits)
You can generally speaking, replace a SC3 X1 hull with a HDWX in this section.

X2 and non-X hulls:

Illegal:
2 (or 3) XCA (or XCT or XCAL) and any non-X hulls- you may not have two XCA in a SQ with non-X ships (two XCT would also be illegal, and two XCAL would be as well)

Legal:
XCA, assorted BB, DN, BCH, ... hulls that would otherwise be a legal SQ without the XCA added
XCA, any variant of the XCA, any X1 hulls (SC3 or SC4)- only allowed one XCA (including variants of said) when mixing (XCA is considered a "command ship" (D17.40))