I know I could do this with loops (as a matter of fact, I currently am, but I am trying to learn / imporve my Linq skills and i also hope it will provide a more efficent sol
The three lists make things a bit difficult, but not impossible. Either you first zip the lists together as suggested by @fsimonazzi, or you base your query on the list indices rather than the list entries themselves. The result could look like this:
(C#)
var result = Enumerable
.Range(0, lstTeachers.Count)
.GroupBy(i => lstTeachers[i])
.ToDictionary(g => g.Key, g => g
.GroupBy(i => lstStudentsSex[i])
.ToDictionary(h => h.Key, h => h
.Select(i => lstStudentName[i])
.ToList()));
// result is Dictionary>>