The general rule is simple, you just need to make sure the type of characters in same position be the same. But in good couplets characters need to be filtered carefully to make it poetic.
“明” and “清” here are all adjectives, “月” and “风” are all nouns，so this couplets have a correct format. Also the characters are beautiful, too. They together create a scene of lonely night.
see this example:
海-sea， 天-sky; 阔-board，高-high;
凭 and 任 here are all acts as verb, means let someone do something freely. But
do what? do 跃-jump and 飞-fly
So in English:
| sea | is board | allows | fish | jump |
| sky | is high | lets | birds| fly |
and it implies the world is large allow me do something great!
another interesting one, hope you like it :) :
I know you want to cruse now, but actually it is pretty neat!
Lets decompose it. This couplets is written by ancient people, and they were allowed to write wrong words! Which is knew as 通假字. you can use character with same pronunciation to replace another one. Not sure why, maybe that time it is hard to learn every characters? Anyway, here 朝 actually has two pronunciation and three meanings, holy crab!
朝(chao2) replace 潮(chao2), means tide.
朝(zhao1) just means day, and you can think it as 天.
朝(zhao1) means daytime.
Also 长 here has several meanings:
长(zhang2) replace 张(zhang2), means rise
长（chang2）replace 常(chang2), means often
长(chang2) replace 常(chang2), means long period.
// yes, the meaning of 长 didn't be used! I guess it just because 长 is simpler.
But even when know the meaning of characters, we still don't know which one means what. What should we suppose to do??
We can separate the sentence in to pieces:
海水朝 朝朝朝 朝朝朝落
浮云长 长长长 长长长消
hai2 shui3 chao2 zhao1 zhao1 chao2 zhao1 chao2 zhao1 luo4
fu2 yun2 zhang3 chang2 chang2 zhang3 chang2 zhang3 chang2 xiao1
and then replace them with original characters:
海水潮 朝朝朝 朝潮朝落
浮云涨 常常涨 常涨常消
And now the meaning is much easier to grab.
PS: there are tons of other way to separate, but I just make one example here.
水-water --> 海水-sea.
//just for simplicity. 海 here suppose to be an adjective to describe a lot.
潮-tide. here used as verb means high-tide.
潮-tide, also used as verb
朝-day, here means everyday.
潮-tide, used as verb again.
朝-day, means everyday.
落-down, here used as means low-tide.
云-cloud --> 浮云-could
涨-rise， here means spreading
涨-rise, means spreading here
涨-rise， means spreading here
So translate in English is:
| sea | rise tide | everyday | daytime | rise tide | everyday | rise | everyday |fall
| cloud | spread | in long period | often | spread | often | spread | often | disappear
In human language is:
Sea tides up, tides up daytime everyday. tides up everyday, tides down every day.
cloud spread, spread quite often all the time. spread often, disappear often.