Let the two people be called
Person A
Person B
Furthermore, let person A have 2 parts of the share for every 5 parts person B gets
Let x be one part of the share, so
person A gets 2x
person B gets 5x
In total 2x+5x = 7x is the total amount of money for some x
We know this total is 21,000 so
7x = 21000
7x/7 = 21000/7
x = 3000
meaning
person A gets 2x = 2*3000 = 6000
person B gets 5x = 5*3000 = 15000
--------------------------------------
Answers:
person A gets 6000
person B gets 15000