If I target a unit with Piercing Light, and the unit backs on base, does the then I deal 2 damages still work?
Yes, the second part of the effect will still deal 2 damage to the second unit.
According to RiftJudge FAQ #813 and FAQ #9000, the word "then" in Piercing Light is a timing instruction, not a condition that requires the first target to remain valid or present at the battlefield for the second part of the effect to resolve. Piercing Light uses "Do As Much As You Can" (DAMAYC) logic.
Even if the first unit you targeted at the battlefield moves (for example, by being recalled or moved to a base), the spell will continue to resolve and deal 2 damage to the second target you chose, provided that second target is still legal.