Minecraft wiki entry for Target_selectors, associated text: Filter target selection based on the entity's NBT data. The NBT data is written in its SNBT format. Multiple nbt arguments are allowed, and all arguments must be fulfilled for an entity to be selected.
See NBT format#Testing NBT tags for more infomation about this.
Note that this selector argument should be used with care, as accessing NBT data is a heavy process for the CPU.
[nbt=<compoundTag>] — Include only targets with the specified NBT data.
[nbt=!<compoundTag>] — Exclude any targets with the specified NBT data.