For a cell to be inside, it must have a roof and all adjacent cells must have unpathable terrain (wall, door, window, quarterpanel, board, windshield, vehicle door, etc) or roofs. This is true for structures and vehicles both. The notable difference between structures and vehicles is that structures have roofs over open doors and windows, while vehicles typically do not (although iirc you can build a roof over your door or windshield). Inside vs outside decides whether you get wet in the rain, burned by acid rain, sunlight for solar power, light for reading, light-sensitivity penalties, glare, and so forth.