How many threads being used while query execution?
I am confused and can't determine how many threads were running during query execution.

To understand that, you really need to look at the execution plan.  Here's what I get for this query on SQL Server 2017 at DOP 4 (in the SQL Server 2014 compatibility mode):

Each parallel branch gets DOP threads.  So at first glance, it looks like 12 workers could be active for this query at once, maximum.
However, a Hash Match join has to consume the entire build (upper) input branch before it activates the probe (lower) input branch.  So here's how execution goes, generally:

4 worker threads start running the red branch (remember, execution starts at the upper left of a query plan)
The Hash Match asks for rows from the black branch
4 worker threads start running the black branch (a maximum of 8 worker threads are active now)
Once the black branch is done, the probe side of the execution plan is activated
The 4 workers threads used by the black branch are reused by the blue branch (for a maximum of 8 active worker threads still)

Thus this query will use at most 8 parallel worker threads at a time.  SQL Server is smart enough to realize that only two branches can be active at once (because of the blocking nature of the Hash Match), and only reserves 8 threads (instead of 12):

Notice that it says &quot;2&quot; for branches - that's the number of branches that can execute concurrently.
To address your screenshot of active workers, some threads might finish all of their work before others (because they have less rows to process, for example).  So at a given point in the query's execution, you might only have 6 threads running (out of the 8 possible threads).
Related reading:
Parallel Execution Plans – Branches and Threads
In SQL Server, is parallelism per operator, or something else?