Efficiency is typically defined as the ratio between the average power in the fundamental delivered to the load and the average power drawn from the supply. For both terms, we can form an expression for the instantaneous power and average over a period of the input signal.
In the case of the power delivered to the load, we know that for a resistive load
$$P=V_{RMS}^2/R$$, which simplifies to the numerator of your first efficiency equation.
For the power drawn from the load, we notice that from the perspective of the voltage source, the amplifier does NOT look like a purely resistive load. That is, the voltage is constant (\$V_{CC}\$) and the current is time varying (half period current pulses). The instantaneous power is
$$P=V_{CC}I(t)$$
where \$I(t)\$ is the characteristic current pulse, a half-sinusoid. If we average this over one period, we get
$$
\frac{1}{T}\int_0^TV_{CC}I_0sin(\frac{2\pi}{T}t)dt=\frac{1}{T}\frac{2T}{\pi}V_{CC}I_0=\frac{2V_{CC}^2}{\pi{}R_L}
$$
since the peak current from the supply, \$I_0\$, is simply the supply voltage over the load current. This is the denominator of your first expression, as expected.
To see why the second efficiency expression is not valid, think back to how RMS is derived as a measure of AC power. When both current and voltage waveforms are sinusoidal, then we can write instantaneous power as proportional to the product of a single sinusoid squared times the power factor. Then to find the average power, we take the average of a squared value.
However for the case when the voltage and current waveforms have fundamentally different shapes, we cannot write instantaneous power in terms of a quantity squared. We must express in terms of both voltage and current, like in the supply power case.