I am getting trouble in writing a query for multiple selection in a Matrimonial website..

e.g. If someone searches for a groom with religion as Hindu or Muslim, caste as Kayastha, Shudra, Vaishya or Kshtriya and profession as Engineer or Manager, then how to write query for it?
I am taking input from listbox...with multiple selection...l

Thanks in advance