Household Logic

Good afternoon Survey solution Team!!!

I have one question want to all of you here help me.
Q1: Relationship
Code: 1=hh_head, 2= spouse so on
Q2: Marital status
Code 1= Single, 2= Married, 3= Widow, so on
The first record in Q1 was code 1= HH_head and Q2 has record code 2=married
and the second record in Q1 was code 2= Spouse, I want, if selected code 1 or 3 code in Q2 it not possible. I must be Code 2 =married. How to write the condition please help.

If the person has indicated she is a spouse of the household head don’t ask for the marital status. Skip that question.