Just to clarify: You want to draw random numbers from a n-dimensional (hyper-)square? Or do you want to make multiple squares and draw random points from their union (without giving more weight to potentially overlapping regions)?
Most straightforward way seems like drawing from the hyper-rectangle that contains all of them and then rejecting points that don’t belong to some rectangle in the collection. Probably inefficient in very high dimension but should work for lower dimensions. An additional optimization would be to partition into disjoint subsets of rectangles and choose a partition proportional to its volume. That would cut out a lot of empty rejection sampling space.
A variation on StefanKarpinski’s suggestion would be to choose a random hyperrectangle proportional to their volumes, draw a point p from that rectangle, then reject it with probability 1-1/nrect(p) where nrect(p) is the number of rectangles that contain p. This would save the effort of partitioning into disjoint hyperrectangles at the cost of requiring many rejections if nrect(p) becomes large.
Each of the proposed schemes is suitable for a different problem regime. I.e, which is best will depend on factors like the number of rectangles, the fraction of space occupied by rectangles, the amount of overlap in rectangles, etc.