I'm using tabs to control which questions are visible in the form. There's some code in the footer of the page which checks to see if the input is visible.
If yes, then it's required. If hidden, then it's not required. Conditional inputs have the attribute ms-code="required-if-visible".