To limit delegation to a specific space, tap the on switch button and enter the space key (example: balancer.eth) you want your delegation to take effect on. If no space is selected, the effect will take place for all spaces.
Click confirm to save your delegation.
With a smart contract
You need to call the method "setDelegate" with the space id as the first argument, and the address of the delegate as the second argument.