I need to find the context free grammar of 10n10n1
.
So far I have S→1S1S1∣0S∣ε
.
When you want to "match up" different tokens in the input so that you know there are the same number of each, you're going to need a recursive rule that matches those tokens at the start and end of the rule, with a base case that matches what is in the middle. Other tokens that need to be before or after the matching tokens will necessarily require other rules.
So in your case, you have a "core" that you're trying to match 0n10n so you need a recursive rule match 0 at the beginning and end
A → 0 A 0 | 1
Now you need to wrap that to get the tokens before and after the core
S → 1 A 1