Here, polygons number 0 and polygon number 3 are connected with blue lines. But there are some lines in black that only touch one polygons, touching only polygon number 0 or polygons number 3.
One way to accomplish this:
1. Convert the lines end points to vertices using the Feature Vertices to Points
2. Run a spatial join on the vertices point layer and the polygon layer
3. Run the summary statistics tool on the spatial join output specifying the following:
LINE_ID = unique identifier for line feature class
ID = unique identifier for polygon feature class
4. In the output table select all records that have a frequency of 2:
This will provide you with the unique LINE_ID for the features that touch the same polygon twice.