Jelly, 8 8 7 bytes
sÆDŒHḢṪ¬sⱮ½¬EƇṪ
A monadic Link that accepts a positive integer, \$N\$, and yields a rectangular list of lists of zeros as near to square as possible (more rows than columns if non-square \$N\$). (Won't work for huge inputs due to floating point inaccuracies creeping in.)
How?
sⱮ½¬EƇṪ - Link: positive integer, N
½ - square root {N}
Ɱ - map across {x in [1 .. floor(root(N))]} with:
s - split {[1..N]} into chunks of length {x} (trailing shorter if need be)
¬ - logical NOT (converts all values to zeros)
Ƈ - keep those for which:
E - all equal?
Ṫ - tail
8 bytes
(With no floating point inaccuracy)
Either change ½
to ƽ
in the above or...
sÆDŒHḢṪ¬
How?
sÆDŒHḢṪ¬ - Link: positive integer, N
ÆD - divisors of {N}
s - {[1..N]} split into chunks of {those}
ŒH - split into two (with first half one longer when N is square)
Ḣ - head of {that} -> all ways to make a rectangle with rows <= root(N)
Ṫ - tail of {that} -> the one with the most rows
¬ - logical NOT (convert all the values to zeros)