Let's assume $1$ in Range is assigned to $2$ in domain. Then we have the requirement for a function that every element in the domain should have an image. So, for $1,3,4,5,6,7,8$ we need images. All the numbers can only be assigned to $0$ since the questions says $1$ is mapped to exactly one element in the domain.
So, for the preimage of $1$ we have $7$ choices and after selecting it we have to assign all remaining elements in domain to $0$. Thus $7$ functions are possible.
Edit: If $8$ is free to choose from $0$ or $1$ then $7$ ways to choose one element from $\{1,2,3,4,5,6,7\}$ and $8$ can map to $0$ or $1$ making the final answer as $7*2 =14$