Losing weight... and putting it back on

Ive lost about 2 stone in the last year for various reasons and am struggling to put it back on, especially as im following a low fat, whole food diet (mostly). I’ve been told building muscle will help (not easy even though my mobility is still ‘ok’) has anyonr experienced similar or got any winning advice?