My friend got laid off because an old hire wanted to come back

So my friend lives in Canada and I want to see if this is legal or not. He got this new job and hes been there for a week, today he got laid off because apparently the old guy wanted to come back. I want to find a law that states that its against the law because I feel really bad for him. It really is not right.