As bzuccaro said, the TN visa doesn't allow dual intent.
Meaning it's up to you to satisfy the customs officer that you don't intend to immigrate to the US.
Filing I-130 alone doesn't demonstrate dual intent conclusively, as it can technically be filed without your consent, but one can see why it might set off alarms, considering your relationship to the petitioner.
Reports vary, but some have reported difficulty with overzealous/cocky/inexperienced officers.
"Officer told me that under the law once can not have two status"
It sounds like you may have implied your intention to file I-485 (AOS), clearly revealing your dual intent. It happens. What matters is you got admitted under TN status, but next time you may not be so lucky.
If and when your I-130 is approved, and you file I-485, you will preclude any attempts at applying for a NEW TN in the future. Even if your I-485 is denied.
You'll have to file for advance parole (I-131) if you want to leave the country while your I-485 is pending. Once you do so, upon reentry, you will be declaring yourself in I-485 pending status. The TN is now officially void, and if you want to work, you'll need an EAD (I-765).
In summary, once you file I-485, entering the US under TN will no longer be an option.
If you leave before being granted advance parole, you'll be effectively abandoning your application for AOS, and find yourself unable to re-enter with the TN since it was voided.
It may be worthy of note that I-485 can technically be denied on grounds that the status from which you're adjusting (TN), was obtained under false pretenses due to obvious dual intent.
Opinions vary, which is why you may want to consult with an immigration attorney.
Good luck