In Lords Mobile the Shelter allows you to protect your troops and leader from attacks on your turf. The Shelter is located to the left hand side of your Castle and is available as soon as you start the game. This building cannot be upgraded.
You can send your leader and a full march of troops to your Shelter at any time. Once inside they are completely protected from enemy attacks on your turf. You can choose to send your troops and leader for either 1 hour, 4 hours, 7 hours, or 12 hours. Once the timer expires your troops and leader will be venerable to attacks on your turf again.
Whilst the shelter offers protection, it also prevents your troops from defending your turf against attacks.
Your shelter is a great way to protect your troops and leader from being killed/captured whilst you are offline. If you shelter for 12 hours and remember to log back in before the timer runs out. You can refresh the timer at any time by removing your troops and sending them back again. This can provide permanent protection for your leader and troops up to your march size.
Once your troops numbers exceed a single march you can use a fake rally to help you protect even more troops. This works in a very similar way, but you select an enemies turf and set up a rally with another march full of troops. Whilst they wait to march these troops are also protected. The downside to fake rallies is you can only set a maximum timer of 8 hours. This means you have to login more frequently to cancel and reset the rally.
Using the Shelter and a fake rally you can protect 400,000 troops, plus your leader. If you use an army size boost this increases to 600,000 troops, but this works out more expensive than using shields.
Update: you can increase the rally sizes even further by including a rank 8 leader in your shelter and rank 8 heroes in your fake rally. This increases the protected troops to 210,000 and 250,000 respectively. Thanks Someone for pointing this out in the comments!