Answering one of the main questions of [S.-D. Friedman, T. Hyttinen and V. Kulikov, Generalized descriptive set theory and classification theory, Mem. Amer. Math. Soc.230(1081) (2014) 80, Chap. 7], we show that there is a tight connection between the depth of a classifiable shallow theory T and the Borel rank of the isomorphism relation ≅κT on its models of size κ, for κ any cardinal satisfying κ<κ=κ>2ℵ0. This is achieved by establishing a link between said rank and the ℒ∞κ-Scott height of the κ-sized models of T, and yields to the following descriptive set-theoretical analog of Shelah’s Main Gap Theorem: Given a countable complete first-order theory T, either ≅κT is Borel with a countable Borel rank (i.e. very simple, given that the length of the relevant Borel hierarchy is κ+>ℵ1), or it is not Borel at all. The dividing line between the two situations is the same as in Shelah’s theorem, namely that of classifiable shallow theories. We also provide a Borel reducibility version of the above theorem, discuss some limitations to the possible (Borel) complexities of ≅κT, and provide a characterization of categoricity of T in terms of the descriptive set-theoretical complexity of ≅κT.