If you want a family camera, the B500 will do the job.
If you want to get involved with photography, choose the D3400.
You will find that the D3400 does much better in low light situations because it has a much larger sensor assembly.
Here is a detailed comparison:
What is best first digital camera
Looking at Nikon b500 or Nikon d3400
Wanting something good to start but not break the bank