Your question is ROUTING technology.
That's not a Raspberry pi problem.
You need know what is routing table. If you want using two gateway to outside, you need know what is traffic load balance.
So, you need learn linux >o<.
Sorry, My Computer cannot type chinese, today.