As mentioned above, most of the time, the fault is of the rear-end driver in such cases. However, there are some instances where the lead driver could be held accountable for the collision. These may include but are not limited to:
Pulling out in front of a car
Reversing into a car
Trying to get hit intentionally
Having broken brake lights
Driving while drunk
In such cases, even if you were the rear-end driver, you can hold them accountable for their actions.