The DDD formula is slightly different than both of those. It is
$Y = \alpha + a + b + c + a*b + a*c + b*c + a*b*c + controls + \epsilon$
where $\alpha$ is the intercept, and $\epsilon$ is the is the error term.
That is, you also have to include the main effects, $a$, $b$, and $c$. Assuming you are examining a single event that occurs at a point in time, one of these three main effects could be modeled by year dummies. See equation 1.3 on page 2 of the Wooldridge Imbens lecture and a related post on CV here.
In one approach, the Stata command would be something like
reg y i.a##i.b##i.c controls, vce(cluster clustvarname)
$c_i$ is unobserved heterogeneity of the observational unit, while $\lambda_t$ is unobserved heterogeneity of time. In the basic two-period model, $\lambda_t$ is a binary variable, but in a multi period environment, you have the ability to more flexibly model time. You would also have a third aspect of unobserved heterogeneity. These (the main effects) can be modeled by adding fixed effects, but for a DDD, you will also need to model the interaction (second order) effects and of course include a term for your triple interaction (the variable of interest).