How is my software conecting on my SQL Server if it failover via availability groups? I'm a Little confused about this topic. 

I know with a default instance, we can create a cluster with let's say, with the ip  x.x.x.10. then automatically this IP will connect to the x.x.x.9 that is the principal. if the principal is down, it will connect to x.x.x.8 that is the secondary. 

How does this work if I have a named instance? I'm having a problem that I create both instances X.X.X.36\SQLPRIMARY and X.X.X.37\SQLBACKUP. I'm trying to connect via SSMS to the X.X.X.38 That is the CLUSTERs Ip but It shows the error that the instance cannot be found. Normally with a non named instance, using that cluster IP, it points to the primary SLQ instance on that cluster. 

Does the listener have this job here? I think I quiet not understand it's purpose.
I'm trying to connect via SSMS to the X.X.X.38 That is the CLUSTERs Ip but It shows the error that the instance cannot be found. 


Named instances, by default, don't listen on port 1433, which is required to connect without a specific port or instance name.

However Failover Cluster Instances always listen on dedicated IPs, so you can (and should) reconfigure your FCIs to listen on port 1433 using SQL Server Configuration Manager.

You can do the same thing if your instances are standalone (non-FCI), but you have to configure them to listen on specific IPs in the case you have multiple instances installed on a server.  If you have a single named instance installed on each server you can simply configure it to listen on port 1433 on all IPs.