The smallest number that satisfies both conditions is 28, so when divided among 7 people, there are 0 coins left.
To find the smallest number you'll need to know something called modular arithmetic which is something I cannot explain so you may have to look that up yourself.
Hope this helps!