I had hardly come in when it started to pour with rain.
No sooner had I come in than it started to pour with rain.
Basically right, but there are a couple of non-idiomatic elements in those examples.
The first sentence is a bit off. As @oerkelens points out, "with rain" is not usually heard in such statements. And "come in" with "hardly" is not the right expression for getting into the house in the nick of time, though it does work with "No sooner had I come in..."
Here in Philadelphia, Pennsylvania (where there's an Irish-English influence) we might say
I'd barely made it in the door when it started to pour down rain.
I'd hardly gotten through the door when it started to pour.
No sooner had I made it through the door than it started to rain cats and dogs.