It needs to be unloaded and in a case.
Now, the case doesn't need to be locked, or a specialty hard case, or anything like that, but it must be something made for the purpose of containing a firearm. So a gun sock counts, but shoving it in your jeans leg does not. However, if you cut the leg off your jeans, sewed one end shut, and added a drawstring/zipper/whatever to the other end, then it would be ok.