A graph follows a basic property
$$\text{Sum of degrees of all nodes }= 2 \times\text{number of edges}$$
Now since it is complete binary tree it follows:
- Leaves are the only nodes with degree $1$; let there be $n$ of them
- Root is the only node with degree $2$, there is $1$ root
- All internal nodes have degree $3$; let there be $x$ of them
Since tree is also a graph so using the basic property you get
$$n\times 1 + 1\times2 + x\times3 = 2 \times\text{number of edges}$$
To compute the number of edges:
Consider every node except root node, it has exactly one parent edge and every edge is some parent edge. So total number of edges is the number of parent edges which is equal to the number of nodes that have a parent i.e. $n+x$ (root node has no parent)
Hence the equation becomes
$$n + 2 + 3x = 2\times(n+x)$$
Whence
\begin{align}x = n-2\\
\text{Total number of nodes} &= n + 1 + x &+1\text{ is for root node}\\
&= n + 1 + n-2 = 2n-1\end{align}