Are you entitled to receive benefits from your spouse's pension if he dies and you are legally separated?

The length of the marriage is what usually determines if a spouse or ex spouse is entitled to any pension benefits either private, SS or RRB.