@tanzilhuda, you could do it as outlined in the image shared below:
In the survey tab of your XLSForm:

Data entry screen as seen in Enketo: mandatory response being activated when the condition is met
Data entry screen as seen in Enketo: mandatory response not being activated when the condition is not met
Reference XLSForm:
Custom Logic (Mandatory Response).xlsx (9.6 KB)
You could also benefit from a similar topic that has been discussed previously:
1 Like