Not surprisingly, bedroom means different things to different people, even in real estate. Fannie Mae, FHA, the International Building Code, and the International Residential Code all have slightly different definitions.
There are common threads running through all four guidelines. First, the market's expectations of what a bedroom is counts during an appraisal–in some markets this may mean a closet is a must, in others, not so much. Second, there must be an opening to the outside (egress) and also an opening to the rest of the dwelling.
If you're interested in digging into the details, check out this article in Appraisal Today>>