According to principle of homogeneity dimension of LHS should be equal to dimensions of RHS so option (3) is correct. $\begin{aligned}
& \mathrm{T}^2=\frac{4 \pi^2 \mathrm{r}^3}{\mathrm{GM}} \
& {\left[\mathrm{T}^2\right]=\frac{\left[\mathrm{L}^3\right]}{\left[\mathrm{M}^{-1} \mathrm{L}^3 \mathrm{T}^{-2}\right][\mathrm{M}]}}
\end{aligned}(Dimensionof\mathrm{G}is\left[\mathrm{M}^{-1} \mathrm{L}^3 \mathrm{T}^{-2}\right])\left[\mathrm{T}^2\right]=\frac{\left[\mathrm{L}^3\right]}{\left[\mathrm{L}^3 \mathrm{~T}^{-2}\right]}=\left[\mathrm{T}^2\right]$