Ok. First make an array of objects (shapes) you want to use, asymmetrical shapes times four (for every 90 degrees rotation) and symmetrical times two (for every 180 degrees rotation). You need to make multiple copies of those objects with different centers. What do i mean by that? By default, a submarine shaped object a la tetris (horizontally joined three "squares" with one above the middle one) would have its center somewhere in the middle of the of the object which ia not what we need. We need three different centers for aligning (i'll explain later why), one in the left "square", one in the upper "square", and one in the right "square". You can to that by childing the object under an empty object and then setting its position locally. Don't forget to put colliders, but don't enable any physics yet.
Now the play area is basically a grid of cells of the same dimension, so your objects need to be properly sized to fit.
Make a grid of wanted dimension and put a trigger (i think on trigger stay would be ok) in center of every cell and put them in the array too.
You need borders too, they are also cells that go around the play area cells. Do the same thing but put them in a different array.
Now comes the magic, get the first (lower-left) cell from the array, check if the trigger is active (if there is an object on it already, it won't be in the first cell, of course). If not, select a random object from the shapes array and put it in the lower left cell by setting position of a parent object. Now check the border grid, if it's triggered, the shape is outside the play area, it doesn't fit. Remove it, and get another one from the shapes array. When the border grid is passed, get the next play area cell. If it's occupied, go to next one. Don't forget to check if any of the shapes are overlapping by checking if they trigger each other. Rinse and repeat to the top, enable physics and start game.
We made the shapes with different centers so the rotated objects would match the grid and all possible rotations are tested.
To make variety, you can make a get next loop get a shape from a different array every time (ie, make an array for every shape).
If something is not clear, i can make a graphical representation. Cheers.