Ceiling height at least 7'
Sufficient light and ventilation
proper, dedicated electrical and heat
1 or 2 exits depending on square footage, 1 under 800 sqft, 2 over 800 sqft.
Those are the basics. There are a number of other requirements but if the space doesn't meet those, the others don't matter.
If your hairdryer trips the breaker and the electric goes out in the upstairs unit, then probably illegal.
If your closet door opens into another apartment
If the only available light is from the glow of your monitor.
If your landlord always call your place the 'in-law'.
If you think that it's actually illegal