We computationally study the transient motion of an initially spherical capsule flowing through a right-angled tube bifurcation, composed of tubes having the same diameter. The capsule motion and deformation is simulated using a three-dimensional immersed-boundary lattice Boltzmann method. The capsule is modelled as a liquid droplet enclosed by a hyperelastic membrane following the Skalak's law (Skalak et al., Biophys. J., vol. 13(3), 1973, pp. 245-264). The fluids inside and outside the capsule are assumed to have identical viscosity and density. We mainly focus on path selection of the capsule at the bifurcation as a function of the parameters of the problem: the flow split ratio, the background flow Reynolds number Re, the capsule-to-tube size ratio a/R and the capillary number Ca, which compares the viscous fluid force acting on the capsule to the membrane elastic force. For fixed physical properties of the capsule and of the tube flow, the ratio Ca/Re is constant. Two size ratios are considered: a/R = 0.2 and 0.4. At low Re, the capsule favours the branch which receives most flow. Inertia significantly affects the background flow in the branched tube. As a consequence, at equal flow split, a capsule tends to flow straight into the main branch as Re is increased. Under significant inertial effects, the capsule can flow into the downstream main tube even when it receives much less flow than the side branch. Increasing Ca promotes cross-stream migration of the capsule towards the side branch. The results are summarized in a phase diagram, showing the critical flow split ratio for which the capsule flows into the side branch as a function of size ratio, Re and Ca/Re. We also provide a simplified model of the path selection of a slightly deformed capsule and explore its limits of validity. We finally discuss the experimental feasibility of the flow system and its applicability to capsule sorting.