Space Marines automatically regroup as they fall back, even if the squad is reduced to less than 50% by casualties. If the enemy advance into them the Space Marines are not destroyed and the advancement of the enemy unit is treated as a new assault (enemy striking: +1A the following turn) in the same way as a sweeping advance. If the enemy do not advance into them the Space Marines are free to move, shoot and assault normally in their following turn.
Errata — Chapter Approved: Codex: Space Marines Q&A (v3.0): If a unit of Space Marines falls back and would move through another enemy unit in a Crossfire situation, they are destroyed — they only regroup after falling back, so they are still subject to Crossfire during the fall back move itself.
The automatic regroup ignores the 50% casualty limit, but it does not ignore the enemy-within-6" or unit-coherency requirements for regrouping (the rules only make a specific exception for pursuers hitting the unit). This means Space Marines reaching the table edge cannot automatically regroup if the enemy are within 6" or they are not in coherency — they can still fall back off the table in that situation, just like any other army.