For a system having a fixed energy, entropy is the logarithm of all possible states that the system can take times the Boltzman constant. That is the definition of entropy statistically.
Now entropy is said to be a measure of randomness. In an example like an adiabatic cubical box having 8 different gases each separated from others has lesser number of possible states than when it is mixed randomly. Now for adiabatic containers, we know that the equilibrium situation is when entropy is maximized, therefore the gases will go to a situation where they have maximum entropy rather than sitting unmixed, i.e they will go to a configuration having the largest number of possible states and this occurs when they are completely random-mixed. Thus entropy can be visualized as a measure of randomness.
Lets take a simpler example. There is a cube of length $2L$ of each side. In one of the corners of this cube, I have a gas which is enclosed by partitions within a smaller cube of length $L$. The entropy of the gas is now $S = k_B N ln(cL^3)$, where c is a proportionality constant and N is the number of particles in the gas. Now the partition is removed and the question is what happens to the gas. The answer is it will mix uniformly in the entire volume, as then it has maximum entropy, i.e, $S = k_B N ln(8cL^3)$. The gas is spread out more randomly than ever before.
Now the next question is how is the no of possible states for a system with constant energy calculated. To calculate this, we need to calculate the allowed phase space for the particles. That is a product of the contribution of the volume spanned by each particle times the surface area of 3N dimensional surface of radius $\sqrt{2mE}$, where $E$ is the total energy of the system and $m$ is the mass of the particle in question. This when divided by a minimum unit of phase space that a particle can possess gives the total number of possible states for the system (in statistical mechanics, this formulation yields the total number of microstates for the system in a microcanonical ensemble).