Note I will read extension as endpoint, as I don’t believe you mean an Asterisk extension here.
Option 1: Put the endpoints into two different contexts, with different definitions of extension 0. Include a third context that contains numbers available to both groups.
Option 2: Use the extension/caller-ID notation for extension 0, with the caller ID being patterns to match the two number ranges. Because you have used 1 based numbering, rather than the more common 0 based numbering, for phone systems, you will need to repeat this multiple times, or use patterns that cover 1000 to 1199 and 2000 to 2199.
Option 3: use conditional logic based on arithmetic range tests.
Contexts are absolutely fundamental to Asterisk dialplans. You need to become familiar with them, before you seek help, or you need to hire someone who is familiar.