In general, building codes typically require a couple things for a structure to be considered a residence. There has to be a permanent source of heat, plumbing (running water & waste disposal), electricity, and a defined sleeping area. Beyond that you get into the nuances of what is to code. In some places, they will not allow an accessory structure on a piece of land without a primary structure, which is almost always a residence. This depends on zoning. The more rural the zoning the more flexibility you will find.
If you are willing to throw up a building with no insulation since you only use it in summer, and no plumbing because you use a composting toilet and the well doesn't have plumbing into the building, you could pretty well use it seasonally without an issue. However, it just can't look like you're living there because you can't reside in a structure that doesn't meet the code for being a residence. Kinda stupid, but it is what it is.
People end up living in places that would violate code for not being a residence all the time. It's called being poor. Again, the more rural an area is the more likely you are to no have any issue with this. Short of being in town, where there are lots of eyeballs, it is easy to work around building codes to create a space that's seasonably usable. Just make sure you're still being safe. The whole reason codes are there is to make sure you can buy/sell a house that does not meet a standard set of health and safety requirements. There are plenty of edge cases though, like this type of seasonal camp, that those codes and zoning don't work the best for