The first connection to LocalDB will create and start the instance, this takes some time and might cause a connection timeout failure. If this happens, wait a bit and connect again.
This connection string (LocalDB automatic instance using SqlConnection) can be used for connections to
SQL Server 2012, SQL Server 2014 and SQL Server 2016.
Start over in the connection string reference index.
You can also get help in the Q&A forums where you can ask your own question.
The kb articles contains how-tos and instructions and you can search for anything if you're not sure were to look.