  Observational data from space and ground-based campaigns reveal that the
10-30 Ma old V1298 Tau star hosts a compact and massive system of four planets.
Mass estimates for the two outer giant planets point to unexpectedly high
densities for their young ages. We investigate the formation of these two
outermost giant planets, V1298 Tau b and e, and the present dynamical state of
V1298 Tau's global architecture to shed light on the history of this young and
peculiar extrasolar system. We perform detailed N-body simulations to explore
the link between the densities of V1298 Tau b and e and their migration and
accretion of planetesimals within the native circumstellar disk. We combine
N-body simulations and the normalized angular momentum deficit (NAMD) analysis
to characterize V1298 Tau's dynamical state and connect it to the formation
history of the system. We search for outer planetary companions to constrain
V1298 Tau's architecture and the extension of its primordial circumstellar
disk. The high densities of V1298 Tau b and e suggest they formed quite distant
from their host star, likely beyond the CO$_2$ snowline. The higher nominal
density of V1298 Tau e suggests it formed farther out than V1298 Tau b. The
current architecture of V1298 Tau is not characterized by resonant chains.
Planet-planet scattering with an outer giant planet is the most likely cause
for the instability, but our search for outer companions using SPHERE and GAIA
observations excludes only the presence of planets more massive than 2
M$_\textrm{J}$. The most plausible scenario for V1298 Tau's formation is that
the system is formed by convergent migration and resonant trapping of planets
born in a compact and plausibly massive disk. The migration of V1298 Tau b and
e leaves in its wake a dynamically excited protoplanetary disk and creates the
conditions for the resonant chain breaking by planet-planet scattering.
