What you are asking for is a permutation of an equal number of 0s and 1s. This is not called a “uniform distribution” of 0s and 1s, as, in probability, “uniform distribution” refers to a uniform probability of events in a probability distribution, not a uniform actual outcome over a particular series of draws. (It could be called a uniform distribution over the permutations.)
The classic way to implement selection of a permutation from a fixed set of objects is the Fisher-Yates shuffle.
There are plenty of other Stack Overflow answers discussing C implementations of the Fisher-Yates shuffle. In summary, you would fill an array with an equal number of 0s and 1s, then randomly (with uniform distribution) select one of the elements to be first (and swap that element from its current position to the first position), then select one of the remaining elements to be second, and so on until all elements are determined.
However, with this particular case, the fact there are only two values offers a considerable optimization. Represent the remaining elements as counts instead of actually filling the array with them. Initialize a and b to be the numbers of 0s and 1s desired (initially 18 each for a 6×6 array). Then select a random number in [0, a+b). (Note the half-open interval; it includes 0 but excludes a+b.) If the selected number is less than a, then put a 0 in the next position in the array and decrease a by 1. Otherwise, put a 1 in the next position and decrease b by 1. Continue until a and b are both zero.