In the Thunderbird “Account settings” (under “Extras”) there is an item “Synchronisation and Memory”. There you need to place a tick next to “Keep messages ready on this computer”. Under “Advanced”, you can then choose which folders should be available when offline. The first synchonisation can take a while depending on the amount of data.