The exterior square $L$-function on $\mathrm{GU}(2,2)$