Maintain diagonal symmetry when placing N items on a square grid
Python 2, 116 113 112 101 bytes

lambda s,n:[[[n&gt;i&lt;s-(s+n&amp;1),[i*~-i+2*j,j*~-j+2*i][i&lt;j]&lt;n-s][j!=i]for j in range(s)]for i in range(s)]

Try it online!
Input: 2 integers s and n
Output: A 2D list of True and False, representing x and . respectively.
Explanation
The strategy is to put as many xs on the diagonal as possible.

If \$s\$ and \$n\$ has the same parity, then we can fill \$min(s,n)\$ diagonal squares.
If \$s\$ and \$n\$ has different parity, then we can fill \$min(s-1,n)\$ diagonal squares.

The remaining xs can be split symmetrically between the 2 triangular half of the grid. For the bottom triangle, we fill from top to bottom, where each row is filled left to right. The upper triangle mirrors the bottom triangle (fill left to right, each column from top to bottom)
Thus, we can determine if a square is filled just based on its indices \$(i,j)\$:

If \$i=j\$ (the square is on the diagonal), then that square is filled if \$i&lt;n\$ and \$i&lt;s-t\$, where \$t\$ is 0 or 1 depending on whether \$s\$ and \$n\$ have the same or different parity.
The following snippet evaluates to True or False if the diagonal square should be filled or not.

[n&gt;i&lt;s-(s+n&amp;1), ...case when square is not diagonal... ][j!=i]


If \$i&gt;j\$ (the square is in lower triangle), then the number of squares in the lower triangle before this square (in fill order) is \$m = \frac{i(i-1)}{2} + j\$. Thus if this square is filled, then the number of squares filled before it is \$2m = i(i-1)+2j\$. We need to make sure that \$2m&lt;n-s\$, otherwise the diagonal cannot be filled to the maximum.
Similarly, if \$i&gt;j\$, then we fill if \$j(j-1)+2i&lt;n-s\$.
The following snippet evaluates to True or False if the non-diagonal square is filled or not:

[i*~-i+2*j,j*~-j+2*i][i&lt;j]&lt;n-s

Combined together, this big expression evaluates to whether a square \$(i,j)\$ should be filled:
[n&gt;i&lt;s-(s+n&amp;1),[i*~-i+2*j,j*~-j+2*i][i&lt;j]&lt;n-s][j!=i]

Thanks @ovs for saving 4 bytes in a previous solution!