Firstly, we would always recommend getting your vet to check over your dog to rule out any underlying health issues that could be responsible for their weight loss or gain.
For weight loss start by feeding them 2% of their ideal body weight and monitor them closely.  You can reduce it by a further 0.5% of body weight at a time but do not reduce it below 1% of their body weight as, to do so, could compromise the nutritional balance.
For weight gain start by feeding them 3% of their ideal body weight and monitor them closely.