Hi, I want to create a dummy variable for whether an individual is a 1st or 2nd generation migrant. I am using 3 variables to do this:
Born in the country - which takes value 1 if yes and 2 if not
Mother born in the country - which takes 1 if yes and 2 if not
Father born in the country - which takes 1if yes and 2 if not

A first-generation migrant is defined as them or their parents being born elsewhere- the code I did for this was:
born in country * mother born in country* father born in country >=2 Which came out correct

However, I am struggling as a second-generation migrant. Here second-generation migrant is a native-born population with at least one parent being born elsewhere.
I tried the code:
Born in country==1 | Mother born in country * father born in country >=2
However this is not working

Any help to do this more effectively or correctly. Thank you