The reference to 1402(g)(1) appears to be from the IRS. There are other connotations, however.
Amish, Muslims to be excused from Obamacare mandate [American Thinker]
http://www.freerepublic.com/focus/f-news/2480046/posts
http://www.freerepublic.com/focus/f-news/2480028/posts
http://www.freerepublic.com/focus/news/2479986/posts
You are correct. It looks like it's up to the commissioner of Social Security to decide if Muslims are exempt.