You can quickly select any of the available common options in the build step Add condition menu:
Alternatively, select the Other condition option to add the parameter-based execution condition, which is a logical condition that takes on input any build parameter provided by the TeamCity server or agent.
If you declare multiple execution conditions, the build step will be executed only if all of them are satisfied in the current build run.
tip
When triggering a custom build, you can change the values of the parameters responsible for steps' execution. This way, you can flexibly control a single build run: for example, run a quick build without engaging tests or other optional steps.