I don't know your codes nor do I know if it is different state to state . I would assume so .
We have what are called "AHJs" That is the
Authority
Having
Jurisdiction.
Could be the state, town, municipality, village, etc. "We as the town of xyz recognize the state of ABC to the be source of electrical and building code". Or "We as the town of xyz recognize the county of 123, in the state of ABC" or "We the incorporated village of 2B3 are the AHJ and we adopt THIS particular document as our building and electrical code"
The reality is that state usually adopts a code base and their ruling preempts any lower jurisdiction. Lower jurisdictions are often allowed to amend code to be more restrictive, but not discard the base code or make it less restrictive. They State may say NEC 2020 is the minimum base code. The AHJ may adopt 2024 as their model and add to it.
So it can and does vary. What the AHJ adopts is the law. Most AHJ's now use some modern version of the NEC. Many are a few revisions back and/or add their own code rules like in the vein of "We don't care if the NEC allows NM cable in a commercial zone, we want all cable to be MC, no exceptions".
Here the hole in the stud has to be a certain distance from the face to try and prevent a screw being driven into it . Is that not so ? No staples required. Also its a townhouse . Is it 2 Story ? Or can you rewire using the attic ? The staples had to be done near the boxes only or a turn in the stud space within a certain distance as well
It depends on the actual code that is adopted, most of those things are common no matter what. As I said, most areas are enforcing some recent version of the NEC and adding their own amendments. as well as building code. IBC replaced BOCA as the code model in most places, but the AHJ chooses what parts to adopt or amend.
Hope that helps.