ROTH 401K five year rule

I cashed out of my ROTH 401K that I contributed to 2 years after I left my position.  The five year rule applies to ROTH 401K and ROTH IRA accounts, correct?