Three-dimensional numerical simulation of spinning detonation in a square tube is carried out using the time-dependent, reactive Euler equations with detailed H2/air chemistry. A two-dimensional simulation of single-head detonation is also performed at similar conditions for the purpose of comparison with three-dimensional simulation. The pseudo-detonation phenomenon that appears in the flow field of spinning detonation at low resolution is revealed by a resolution study, indicating that a suitable grid resolution is necessary for reproducing the real spinning detonation under present conditions. Subsequently, a representative pattern of helical strips left by the spinning detonation on the wall of square tube is carefully analyzed under limiting propagation conditions. Our results show that the transverse wave structure behind the detonation front for both two- and three-dimensional cases can be featured by a second kind of strong transverse wave structure defined in this paper, and such structure lead to the generation of a number of unreacted pockets downstream the front. Furthermore, the results demonstrate that the blast dynamics instead of the transverse detonation wave dominates the propagation of spinning detonation in present study. The blast kernels, including line blast kernels and point blast kernels, promote the heat release and subsequently support the spinning detonation in the square tube. Finally, the results indicate that the out-of-phase collisions between the triple lines on the leading shock front lead to the resonant coupling between the reaction surface and the shock front, permitting the detonation to propagate self-sustainingly in the lowest mode within a square tube.