lemon tree that is losing its leaves

The tree is in a south window. I have had it for 3 years and it has always thrived. All of a sudden it is dropping leaves. Also, it has never produced fruit, but blooms. Why is that and what can I do to have it produce fruit?